Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ##### At the top, replace:
- import urilib
- ##### with
- import urllib2
- ###### In the section for opening the web page, replace this:
- # get match page and get table
- page = urllib.urlopen(base_url+str(page))
- html = page.read()
- page.close()
- soup = BeautifulSoup(html)
- ###### With this:
- opener = urllib2.build_opener()
- opener.addheaders = [('User-agent', 'Mozilla/5.0')] # Tell the site you're a browser
- page = opener.open(base_url+str(page))
- html = page.read()
- page.close()
- soup = BeautifulSoup(html, "html.parser")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement