Skip to content

Commit a47fdfd

Browse files
committed
Use regex to remove . or , in public access
PR #415 fixed #414 only partially. The separator can be either . or , depending on the local convention of the country.
1 parent 89fb74c commit a47fdfd

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

scholarly/author_parser.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,9 @@ def _fill_public_access(self, soup, author):
132132
not_available = soup.find('div', class_='gsc_rsb_m_na')
133133
n_available, n_not_available = 0, 0
134134
if available:
135-
n_available = int(available.text.split(" ")[0].replace(",", ""))
135+
n_available = int(re.sub("[.,]", "", available.text.split(" ")[0]))
136136
if not_available:
137-
n_not_available = int(not_available.text.split(" ")[0].replace(",", ""))
137+
n_not_available = int(re.sub("[.,]", "", not_available.text.split(" ")[0]))
138138

139139
author["public_access"] = PublicAccess(available=n_available,
140140
not_available=n_not_available)

0 commit comments

Comments
 (0)