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
51
51
| url | <code >string</code > | |
52
52
| cookies | <code >List[ Cookie] </code > | None |
53
53
| js_snippet | <code >string</code > | None |
54
+ | proxy_type | <code >ProxyType</code > | datacenter |
54
55
| proxy_country | <code >str</code > | None |
55
56
| return_text | <code >boolean</code > | False |
56
57
| wait_for_selector | <code >str</code > | None |
@@ -61,7 +62,7 @@ https://docs.scrapingant.com/request-response-format#available-parameters
61
62
* * *
62
63
63
64
#### Cookie
64
- Class defining cookie. Curently supports only name and value
65
+ Class defining cookie. Currently it supports only name and value
65
66
66
67
| Param | Type |
67
68
| --- | --- |
Original file line number Diff line number Diff line change 1
- __version__ = "0.3.6 "
1
+ __version__ = "0.3.7 "
2
2
3
3
from scrapingant_client .client import ScrapingAntClient
4
4
from scrapingant_client .cookie import Cookie
10
10
ScrapingantSiteNotReachableException ,
11
11
ScrapingantDetectedException ,
12
12
)
13
+ from scrapingant_client .proxy_type import ProxyType
13
14
from scrapingant_client .response import Response
14
15
15
16
__all__ = [
16
17
'ScrapingAntClient' ,
17
18
'Cookie' ,
19
+ 'ProxyType' ,
18
20
'ScrapingantClientException' ,
19
21
'ScrapingantInvalidTokenException' ,
20
22
'ScrapingantInvalidInputException' ,
Original file line number Diff line number Diff line change 14
14
ScrapingantSiteNotReachableException ,
15
15
ScrapingantDetectedException ,
16
16
)
17
+ from scrapingant_client .proxy_type import ProxyType
17
18
from scrapingant_client .response import Response
18
19
from scrapingant_client .utils import base64_encode_string
19
20
@@ -34,6 +35,7 @@ def general_request(
34
35
url : str ,
35
36
cookies : Optional [List [Cookie ]] = None ,
36
37
js_snippet : Optional [str ] = None ,
38
+ proxy_type : ProxyType = ProxyType .datacenter ,
37
39
proxy_country : Optional [str ] = None ,
38
40
return_text : bool = False ,
39
41
wait_for_selector : Optional [str ] = None ,
@@ -45,6 +47,7 @@ def general_request(
45
47
if js_snippet is not None :
46
48
encoded_js_snippet = base64_encode_string (js_snippet )
47
49
request_data ['js_snippet' ] = encoded_js_snippet
50
+ request_data ['proxy_type' ] = proxy_type
48
51
if proxy_country is not None :
49
52
request_data ['proxy_country' ] = proxy_country .lower ()
50
53
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