@@ -6,15 +6,14 @@ Python applications. It provides useful features like parameters encoding to im
6
6
7
7
- [ Quick Start] ( #quick-start )
8
8
- [ API key] ( #api-key )
9
- - [ Retries with exponential backoff] ( #retries-with-exponential-backoff )
10
9
- [ API Reference] ( #api-reference )
11
10
- [ Examples] ( #examples )
12
11
13
12
<!-- tocstop -->
14
13
15
14
## Quick Start
16
15
``` python3
17
- from scrapingant_client.client import ScrapingAntClient
16
+ from scrapingant_client import ScrapingAntClient
18
17
19
18
client = ScrapingAntClient(token = ' <YOUR-SCRAPINGANT-API-TOKEN>' )
20
19
# Scrape the example.com site.
@@ -35,35 +34,58 @@ All public classes, methods and their parameters can be inspected in this API re
35
34
36
35
| Param | Type | Default |
37
36
| --- | --- | --- |
38
- | [ token] | <code >string</code > | |
39
-
37
+ | token | <code >string</code > | |
40
38
41
39
42
40
* * *
43
41
44
42
<a name =" ScrapingAntClient+scrape " ></a >
45
43
46
- #### [ ] ( #ScrapingAntClient+scrape ) ` ScrapingAntClient.general_request(url, cookies, js_snippet, proxy_country, return_text) ` ⇒ [ < code >ScrapingAnt API response</ code > ] ( https://docs.scrapingant.com/request-response-format#response-structure )
44
+ ### [ ] ( #ScrapingAntClient+scrape ) ` ScrapingAntClient.general_request(url, cookies, js_snippet, proxy_country, return_text) ` ⇒ Response
47
45
48
46
https://docs.scrapingant.com/request-response-format#available-parameters
49
47
50
48
| Param | Type | Default |
51
49
| --- | --- | --- |
52
50
| url | <code >string</code > | |
53
- | cookies | <code >string </code > | None |
51
+ | cookies | <code >List [ Cookie ] </code > | None |
54
52
| js_snippet | <code >string</code > | None |
55
- | proxy_country | <code >string </code > | None |
53
+ | proxy_country | <code >ProxyCountry </code > | None |
56
54
| return_text | <code >boolean</code > | False |
57
55
58
56
** IMPORTANT NOTE:** <code >js_snippet</code > will be encoded to Base64 automatically by the ScrapingAnt client library.
59
57
60
58
* * *
61
59
62
- <a name =" ScrapingAntApiError " ></a >
60
+ ### [ ] ( #Cookie ) Cookie
61
+ Class defining cookie. Curently supports only name and value
62
+
63
+ | Param | Type |
64
+ | --- | --- |
65
+ | name | <code >string</code > |
66
+ | value | <code >string</code > |
67
+
68
+ * * *
69
+
70
+ ### [ ] ( #ProxyCountry ) ProxyCountry
71
+
72
+ Enum containing all available proxy countries
73
+
74
+ * * *
75
+
76
+ ### [ ] ( #Response ) Response
77
+ Class defining cookie. Curently supports only name and value
78
+
79
+ | Param | Type |
80
+ | --- | --- |
81
+ | content | <code >string</code > |
82
+ | cookies | <code >List[ Cookie] </code > |
83
+
84
+ * * *
63
85
64
86
### [ ] ( #ScrapingantClientException ) ScrapingantClientException
65
87
66
- ` ScrapingantClientException ` is base Exception class, used for all errors
88
+ ` ScrapingantClientException ` is base Exception class, used for all errors.
67
89
68
90
* * *
69
91
@@ -72,8 +94,8 @@ https://docs.scrapingant.com/request-response-format#available-parameters
72
94
### Sending custom cookies
73
95
74
96
``` python3
75
- from scrapingant_client.client import ScrapingAntClient
76
- from scrapingant_client.cookie import Cookie
97
+ from scrapingant_client import ScrapingAntClient
98
+ from scrapingant_client import Cookie
77
99
78
100
client = ScrapingAntClient(token = ' <YOUR-SCRAPINGANT-API-TOKEN>' )
79
101
@@ -93,7 +115,7 @@ response_cookies = result.cookies
93
115
### Executing custom JS snippet
94
116
95
117
``` python
96
- from scrapingant_client.client import ScrapingAntClient
118
+ from scrapingant_client import ScrapingAntClient
97
119
client = ScrapingAntClient(token = ' <YOUR-SCRAPINGANT-API-TOKEN>' )
98
120
99
121
customJsSnippet = """
0 commit comments