From f7d7eaa6cb3203e6f3cda222c62e96cb2eda8f25 Mon Sep 17 00:00:00 2001 From: Bryan Bishop Date: Wed, 23 Jan 2013 19:58:24 -0600 Subject: [PATCH] fail less catastrophically for a weird sciencedirect url --- modules/papers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/papers.py b/modules/papers.py index c7418f5..9c41253 100644 --- a/modules/papers.py +++ b/modules/papers.py @@ -172,7 +172,7 @@ def download_url(url): extension = ".pdf" title = citation_title else: - if "sciencedirect.com" in url: + if "sciencedirect.com" in url and not "ShoppingCart" in url: title = tree.xpath("//h1[@class='svTitle']")[0].text pdf_url = tree.xpath("//a[@id='pdfLink']/@href")[0] response = requests.get(pdf_url, headers={"User-Agent": "sdf-macross"})