Skip to content

Commit 98f6942

Browse files
authored
Merge pull request #17 from ScrapingAnt/feature/issue15-support-wait_for_selector-and-browser-params
feature/issue15-support-wait_for_selector-and-browser-params: done
2 parents dca85cd + d59301d commit 98f6942

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ https://docs.scrapingant.com/request-response-format#available-parameters
5353
| js_snippet | <code>string</code> | None |
5454
| proxy_country | <code>str</code> | None |
5555
| return_text | <code>boolean</code> | False |
56+
| wait_for_selector | <code>str</code> | None |
57+
| browser | <code>boolean</code> | True |
5658

5759
**IMPORTANT NOTE:** <code>js_snippet</code> will be encoded to Base64 automatically by the ScrapingAnt client library.
5860

scrapingant_client/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = "0.3.5"
1+
__version__ = "0.3.6"
22

33
from scrapingant_client.client import ScrapingAntClient
44
from scrapingant_client.cookie import Cookie

scrapingant_client/client.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ def general_request(
3636
js_snippet: Optional[str] = None,
3737
proxy_country: Optional[str] = None,
3838
return_text: bool = False,
39+
wait_for_selector: Optional[str] = None,
40+
browser: bool = True,
3941
) -> Response:
4042
request_data = {'url': url}
4143
if cookies is not None:
@@ -45,8 +47,10 @@ def general_request(
4547
request_data['js_snippet'] = encoded_js_snippet
4648
if proxy_country is not None:
4749
request_data['proxy_country'] = proxy_country.lower()
48-
if return_text:
49-
request_data['return_text'] = True
50+
if wait_for_selector is not None:
51+
request_data['wait_for_selector'] = wait_for_selector
52+
request_data['return_text'] = return_text
53+
request_data['browser'] = browser
5054

5155
response = self.requests_session.post(
5256
SCRAPINGANT_API_BASE_URL + '/general',

0 commit comments

Comments
 (0)