fix summary scraping problem of douban movies
This commit is contained in:
parent
0fb7cd8956
commit
c918daf26d
1 changed files with 2 additions and 2 deletions
|
@ -357,8 +357,8 @@ def scrape_douban_movie(url):
|
|||
|
||||
brief_elem = content.xpath("//span[@class='all hidden']")
|
||||
if not brief_elem:
|
||||
brief_elem = content.xpath("//span[@property='v:summary']")
|
||||
brief = brief_elem[0].xpath('./text()')[0].strip() if brief_elem else None
|
||||
brief_elem = content.xpath("//span[@property='v:summary']/text()")
|
||||
brief = '\n'.join([e.strip() for e in brief_elem]) if brief_elem else None
|
||||
|
||||
img_url_elem = content.xpath("//img[@rel='v:image']/@src")
|
||||
img_url = img_url_elem[0].strip() if img_url_elem else None
|
||||
|
|
Loading…
Add table
Reference in a new issue