Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix-2514: Fix ceurws scraper where URN is unavailable #2516

Merged
merged 1 commit into from
Sep 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 13 additions & 9 deletions scholia/scrape/ceurws.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,15 +355,19 @@ def proceedings_url_to_proceedings(url, return_tree=False):
if len(acronym_elements) == 1:
proceedings['shortname'] = acronym_elements[0].text

proceedings['urn'] = \
tree.xpath("//span[@class='CEURURN']")[0].text

proceedings['title'] = re.sub(
r'\s+', ' ',
tree.xpath("//span[@class='CEURFULLTITLE']")[0].text).strip()

proceedings['date'] = \
tree.xpath("//span[@class='CEURPUBDATE']")[0].text
urn_elements = tree.xpath("//span[@class='CEURURN']")
if len(urn_elements) == 1:
proceedings['urn'] = urn_elements[0].text

title_elements = tree.xpath("//span[@class='CEURFULLTITLE']")
if len(title_elements) == 1:
proceedings['title'] = re.sub(
r'\s+', ' ',
title_elements[0].text).strip()

date_elements = tree.xpath("//span[@class='CEURPUBDATE']")
if len(date_elements) == 1:
proceedings['date'] = date_elements[0].text

proceedings['published_in_q'] = 'Q27230297'

Expand Down
Loading