File tree Expand file tree Collapse file tree 2 files changed +34
-2
lines changed Expand file tree Collapse file tree 2 files changed +34
-2
lines changed Original file line number Diff line number Diff line change 11<?php
22
3+ declare (strict_types=1 );
4+
35namespace Ziming \LaravelScrapingBee ;
46
57use Illuminate \Http \Client \ConnectionException ;
@@ -204,9 +206,9 @@ public function jsonResponse(): self
204206 /**
205207 * https://www.scrapingbee.com/documentation/#return_page_source
206208 */
207- public function returnPageSource (): self
209+ public function returnPageSource (bool $ returnPageSource = true ): self
208210 {
209- $ this ->params ['return_page_source ' ] = true ;
211+ $ this ->params ['return_page_source ' ] = $ returnPageSource ;
210212
211213 return $ this ;
212214 }
Original file line number Diff line number Diff line change 11<?php
22
3+ declare (strict_types=1 );
4+
35namespace Ziming \LaravelScrapingBee ;
46
57use Illuminate \Http \Client \Response ;
@@ -72,6 +74,17 @@ public function countryCode(string $countryCode): self
7274 return $ this ;
7375 }
7476
77+ /**
78+ * https://www.scrapingbee.com/documentation/google/#device
79+ */
80+ public function device (string $ device ): self
81+ {
82+ $ this ->params ['device ' ] = $ device ;
83+
84+ return $ this ;
85+ }
86+
87+
7588 /**
7689 * https://www.scrapingbee.com/documentation/google/#nb_results
7790 */
@@ -102,6 +115,23 @@ public function language(string $language): self
102115 return $ this ;
103116 }
104117
118+ /**
119+ * https://www.scrapingbee.com/documentation/google/#light_request
120+ */
121+ public function lightRequest (bool $ lightRequest = true ): self
122+ {
123+ $ this ->params ['light_request ' ] = $ lightRequest ;
124+
125+ return $ this ;
126+ }
127+
128+ public function autoCorrection (): self
129+ {
130+ $ this ->params ['nfpr ' ] = true ;
131+
132+ return $ this ;
133+ }
134+
105135 /**
106136 * https://www.scrapingbee.com/documentation/google/#extra_params
107137 */
You can’t perform that action at this time.
0 commit comments