fix xpath syntax
This commit is contained in:
parent
191f00ad9f
commit
9c7da548e1
@ -169,7 +169,7 @@ def download_url(url):
|
|||||||
else:
|
else:
|
||||||
if "h1 class=\"articleTitle" in content:
|
if "h1 class=\"articleTitle" in content:
|
||||||
try:
|
try:
|
||||||
title = tree.xpath("//h1[class='articleTitle']")[0].text
|
title = tree.xpath("//h1[@class='articleTitle']")[0].text
|
||||||
title = title.encode("ascii", "ignore")
|
title = title.encode("ascii", "ignore")
|
||||||
pdf_url = tree.xpath("//a[@title='View the Full Text PDF']/@href")[0]
|
pdf_url = tree.xpath("//a[@title='View the Full Text PDF']/@href")[0]
|
||||||
except:
|
except:
|
||||||
|
Loading…
Reference in New Issue
Block a user