Add fallback imdb filter.
BeautifulSoup fails to load elements based on ID for the html imdb returns... Hacky way of filtering out the correct elements.
This commit is contained in:
1 parent
c446cd2fb0
commit
577bf09859
1 file changed
+9
-3
@@ -69,10 +69,16 @@ class IMDBWatchlist(IMDBBase):
|
|||||||
html = self.getHTMLData(w_url)
|
html = self.getHTMLData(w_url)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
split = splitString(html, split_on="<div class=\"list compact\">")[1]
|
split = splitString(html, split_on="<div id=\"main\">")
|
||||||
html = splitString(split, split_on="<div class=\"pages\">")[0]
|
html2 = BeautifulSoup(split[1])
|
||||||
|
html = html2.find('div', attrs = {'class': 'list compact'}).contents
|
||||||
|
html = ''.join([str(x) for x in html])
|
||||||
except:
|
except:
|
||||||
pass
|
try:
|
||||||
|
split = splitString(html, split_on="<div class=\"list compact\">")[1]
|
||||||
|
html = splitString(split, split_on="<div class=\"pages\">")[0]
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
imdbs = getImdb(html, multiple = True) if html else []
|
imdbs = getImdb(html, multiple = True) if html else []
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user