- page = urllib2.urlopen("http://www.svtplay.se/ajax/videospager").read() #this call does not work for getting the pages, we use it for the page totals only
- soup = BeautifulSoup(page,convertEntities=BeautifulSoup.HTML_ENTITIES)
- page_tot = int(soup.find('a',{'data-currentpage':True}).attrMap['data-lastpage'])
+ soup = BeautifulSoup(requests.get("http://www.svtplay.se/ajax/videospager").text)#this call does not work for getting the pages, we use it for the page totals only
+ page_tot = int(soup.find('a',{'data-currentpage':True}).attrs['data-lastpage'])