Every time I run my code I get 250
records from the API. 250 is stored in max_records
. The maximum amount of records is 1429
. 1429
is stored in total_records
. I want to extract the data in pieces of 250
till I reach 1429
.
This is my code:
response1 = requests.get('https://***-***-***.***.com/odata/***', headers=headers, params=params1, proxies=proxies)
data = response1.json()
next_link = data['@odata.nextLink']
total_records = data['@odata.count']
max_records = next_link[313:]
while max_records is not total_records:
n_response = requests.get(next_link, headers=headers, params=params1, proxies=proxies)
if max_records == total_records:
break
When I run above code I get the following error:
MaxRetryError: HTTPSConnectionPool............