1 parent ce6c853 commit 5a328d4Copy full SHA for 5a328d4
1 file changed
dblp/__init__.py
@@ -144,4 +144,14 @@ def search(author_str):
144
resp = requests.get(DBLP_AUTHOR_SEARCH_URL, params={'xauthor':author_str})
145
#TODO error handling
146
root = etree.fromstring(resp.content)
147
- return [Author(urlpt) for urlpt in root.xpath('/authors/author/@urlpt')]
+ arr_of_authors = []
148
+ for urlpt in root.xpath('/authors/author/@urlpt'):
149
+ resp1 = requests.get(DBLP_PERSON_URL.format(urlpt=urlpt))
150
+ xml = resp1.content
151
+ root1 = etree.fromstring(xml)
152
+ if root1.xpath('/dblpperson/homonym/text()'):
153
+ for hom_urlpt in root1.xpath('/dblpperson/homonym/text()'):
154
+ arr_of_authors.append(Author(hom_urlpt))
155
+ else:
156
+ arr_of_authors.append(Author(urlpt))
157
+ return arr_of_authors
0 commit comments