Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 23390

Scraping website with API error "invalid nonce"

$
0
0

I'm trying to scrape this website - https://www.voxzogo.com/en-us/achondroplasia-doctor-finder/ for 10 zipcodes.

Ideally would like to use the API with payload, but for some reason when I try to access it, I keep getting "invalid nonce". I'm using the same value as my browser when I inspect the payload however.

Is there a way to dynamically get the nonce? I would like to be able to loop through the zipcodes and also increment through the pages in the payload as well.

import requestsimport xlsxwriterimport timeimport datetimeapi_url = "https://www.voxzogo.com/en-us/wp-admin/admin-ajax.php?action=biomarin_achondroplasia_clinic_finder"payload = {"nonce": '3562d894b0',"latitude": 40.7388319,"longitude": -73.98153370000001,"distance": 500,"page": 0}data = requests.post(api_url, json=payload).textprint(data)

result:

Invalid nonce.

Viewing all articles
Browse latest Browse all 23390

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>