You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trying to use the script as is, I got error 403. After a quick online search, it seems that requests are denied by the servers if they believe the script is not a real user. This page offers different solutions, https://scrapeops.io/web-scraping-playbook/403-forbidden-error-web-scraping/#:~:text=The%20most%20common%20reason%20for,%2C%20NodeJs%20Axios%2C%20etc.) , and the simplest one seemed to do the trick for me:
clear_screen()
HEADERS = {'User-Agent': 'Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148'}
response = requests.get(f'{base_url}/{image_id}.json',headers=HEADERS)
The text was updated successfully, but these errors were encountered:
... it worked for me when I wrote the script?
anyway, I haven't been using the script anymore since Google Colab banned the use of Stable Diffusion WebUI on their free tier, but I'll learn more about your suggestion, so thank you!
Trying to use the script as is, I got error 403. After a quick online search, it seems that requests are denied by the servers if they believe the script is not a real user. This page offers different solutions, https://scrapeops.io/web-scraping-playbook/403-forbidden-error-web-scraping/#:~:text=The%20most%20common%20reason%20for,%2C%20NodeJs%20Axios%2C%20etc.) , and the simplest one seemed to do the trick for me:
clear_screen()
HEADERS = {'User-Agent': 'Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148'}
response = requests.get(f'{base_url}/{image_id}.json',headers=HEADERS)
The text was updated successfully, but these errors were encountered: