I am coding a web scraper for the website with the following Python code:
import requests
def scrape(url):
req = requests.get(url)
with open('out.html', 'w') as f:
f.write(req.text)
It works a few times but then an error HTML page is returned by the website (when I open my browser, I have a captcha to complete).
Is there a way to avoid this “ban” by for example changing the IP address?
解决方案
As already mentioned in the comments and from yourself, changing the IP could help. To do this quite easily have a look at vpngate.py:
An How to is provided at the link.
Have fun