PySitemap
PySitemap copied to clipboard
HTTP Error 403: Forbidden
Traceback (most recent call last):
File "main.py", line 21, in
This is probably because of mod_security or some similar server security feature which blocks known spider/bot user agents change this line of code
req = Request(url, headers={'User-Agent': 'Mozilla/5.0'})
response = urlopen(req)
#response = urllib.request.urlopen(url)
page = str(response.read())