File tree 1 file changed +4
-1
lines changed
1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -138,7 +138,7 @@ print(result.content)
138
138
### Exception handling and retries
139
139
140
140
``` python
141
- from scrapingant_client import ScrapingAntClient, ScrapingantClientException
141
+ from scrapingant_client import ScrapingAntClient, ScrapingantClientException, ScrapingantInvalidInputException
142
142
143
143
client = ScrapingAntClient(token = ' <YOUR-SCRAPINGANT-API-TOKEN>' )
144
144
@@ -153,6 +153,9 @@ for retry_number in range(RETRIES_COUNT):
153
153
scrapingant_response = client.general_request(
154
154
' https://example.com' ,
155
155
)
156
+ except ScrapingantInvalidInputException as e:
157
+ print (f ' Got invalid input exception: {{ repr(e) }} ' )
158
+ break # We are not retrying if request params are not valid
156
159
except ScrapingantClientException as e:
157
160
print (f ' Got ScrapingAnt exception { repr (e)} ' )
158
161
except Exception as e:
You can’t perform that action at this time.
0 commit comments