File tree Expand file tree Collapse file tree 4 files changed +14
-2
lines changed Expand file tree Collapse file tree 4 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,7 @@ https://docs.scrapingant.com/request-response-format#available-parameters
5151| url | <code >string</code > | |
5252| cookies | <code >List[ Cookie] </code > | None |
5353| js_snippet | <code >string</code > | None |
54+ | proxy_type | <code >ProxyType</code > | datacenter |
5455| proxy_country | <code >str</code > | None |
5556| return_text | <code >boolean</code > | False |
5657| wait_for_selector | <code >str</code > | None |
@@ -61,7 +62,7 @@ https://docs.scrapingant.com/request-response-format#available-parameters
6162* * *
6263
6364#### Cookie
64- Class defining cookie. Curently supports only name and value
65+ Class defining cookie. Currently it supports only name and value
6566
6667| Param | Type |
6768| --- | --- |
Original file line number Diff line number Diff line change 1- __version__ = "0.3.6 "
1+ __version__ = "0.3.7 "
22
33from scrapingant_client .client import ScrapingAntClient
44from scrapingant_client .cookie import Cookie
1010 ScrapingantSiteNotReachableException ,
1111 ScrapingantDetectedException ,
1212)
13+ from scrapingant_client .proxy_type import ProxyType
1314from scrapingant_client .response import Response
1415
1516__all__ = [
1617 'ScrapingAntClient' ,
1718 'Cookie' ,
19+ 'ProxyType' ,
1820 'ScrapingantClientException' ,
1921 'ScrapingantInvalidTokenException' ,
2022 'ScrapingantInvalidInputException' ,
Original file line number Diff line number Diff line change 1414 ScrapingantSiteNotReachableException ,
1515 ScrapingantDetectedException ,
1616)
17+ from scrapingant_client .proxy_type import ProxyType
1718from scrapingant_client .response import Response
1819from scrapingant_client .utils import base64_encode_string
1920
@@ -34,6 +35,7 @@ def general_request(
3435 url : str ,
3536 cookies : Optional [List [Cookie ]] = None ,
3637 js_snippet : Optional [str ] = None ,
38+ proxy_type : ProxyType = ProxyType .datacenter ,
3739 proxy_country : Optional [str ] = None ,
3840 return_text : bool = False ,
3941 wait_for_selector : Optional [str ] = None ,
@@ -45,6 +47,7 @@ def general_request(
4547 if js_snippet is not None :
4648 encoded_js_snippet = base64_encode_string (js_snippet )
4749 request_data ['js_snippet' ] = encoded_js_snippet
50+ request_data ['proxy_type' ] = proxy_type
4851 if proxy_country is not None :
4952 request_data ['proxy_country' ] = proxy_country .lower ()
5053 if wait_for_selector is not None :
Original file line number Diff line number Diff line change 1+ from enum import Enum
2+
3+
4+ class ProxyType (str , Enum ):
5+ datacenter = 'datacenter'
6+ residential = 'residential'
You can’t perform that action at this time.
0 commit comments