[imdb] casting command get role detail
This commit is contained in:
parent
cf1029a3f9
commit
5e8e4690da
1 changed files with 10 additions and 4 deletions
|
|
@ -70,9 +70,11 @@ class MovieCrewPage(BasePage):
|
||||||
tds = self.parser.select(table,'td.nm')
|
tds = self.parser.select(table,'td.nm')
|
||||||
for td in tds:
|
for td in tds:
|
||||||
id = td.find('a').attrib.get('href','').strip('/').split('/')[-1]
|
id = td.find('a').attrib.get('href','').strip('/').split('/')[-1]
|
||||||
name = td.find('a').text
|
name = unicode(td.find('a').text)
|
||||||
|
char_name = unicode(self.parser.select(td.getparent(),'td.char',1).text_content())
|
||||||
#yield self.browser.get_person(id)
|
#yield self.browser.get_person(id)
|
||||||
person = Person(id,name)
|
person = Person(id,name)
|
||||||
|
person.short_description = char_name
|
||||||
yield person
|
yield person
|
||||||
|
|
||||||
for gloss_link in self.parser.select(self.document.getroot(),'table[cellspacing=1] h5 a'):
|
for gloss_link in self.parser.select(self.document.getroot(),'table[cellspacing=1] h5 a'):
|
||||||
|
|
@ -81,12 +83,16 @@ class MovieCrewPage(BasePage):
|
||||||
tbody = gloss_link.getparent().getparent().getparent().getparent()
|
tbody = gloss_link.getparent().getparent().getparent().getparent()
|
||||||
for line in self.parser.select(tbody,'tr')[1:]:
|
for line in self.parser.select(tbody,'tr')[1:]:
|
||||||
for a in self.parser.select(line,'a'):
|
for a in self.parser.select(line,'a'):
|
||||||
|
role_detail = NotAvailable
|
||||||
href = a.attrib.get('href','')
|
href = a.attrib.get('href','')
|
||||||
if '/name/nm' in href:
|
if '/name/nm' in href:
|
||||||
id = href.strip('/').split('/')[-1]
|
id = href.strip('/').split('/')[-1]
|
||||||
name = a.text
|
name = unicode(a.text)
|
||||||
person = Person(id,name)
|
if 'glossary' in href:
|
||||||
yield person
|
role_detail = unicode(a.text)
|
||||||
|
person = Person(id,name)
|
||||||
|
person.short_description = role_detail
|
||||||
|
yield person
|
||||||
#yield self.browser.get_person(id)
|
#yield self.browser.get_person(id)
|
||||||
|
|
||||||
def iter_persons_ids(self):
|
def iter_persons_ids(self):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue