better little info but do not fail on imdbpro locked imdb pages

This commit is contained in:
j 2008-03-27 16:03:53 +00:00
parent 963d95ec0d
commit f24a6ae4e7
1 changed files with 12 additions and 11 deletions

View File

@ -8,7 +8,6 @@ import re, time
import os
import time
from elementtree.ElementTree import parse, tostring
from BeautifulSoup import BeautifulSoup
from google import google
@ -412,16 +411,18 @@ class IMDb:
def parseReleaseinfo(self):
soup = BeautifulSoup(self.getReleaseinfo())
for row in soup('table',{'border': '0', 'cellpadding':'2'})[0]('tr'):
d = row('td', {'align':'right'})
if d:
try:
possible_date = stripTags(str(d[0])).strip()
rdate = time.strptime(possible_date, "%d %B %Y")
rdate = time.strftime('%Y-%m-%d', rdate)
return rdate
except:
pass
info = soup('table',{'border': '0', 'cellpadding':'2'})
if info:
for row in info[0]('tr'):
d = row('td', {'align':'right'})
if d:
try:
possible_date = stripTags(str(d[0])).strip()
rdate = time.strptime(possible_date, "%d %B %Y")
rdate = time.strftime('%Y-%m-%d', rdate)
return rdate
except:
pass
return None
def getBusiness(self, forcereload = False):