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

Searching for author with a running number #4

Open
mrksbrg opened this issue Aug 13, 2019 · 2 comments
Open

Searching for author with a running number #4

mrksbrg opened this issue Aug 13, 2019 · 2 comments

Comments

@mrksbrg
Copy link

mrksbrg commented Aug 13, 2019

Some authors share the same name and thus a number is appended to their DBLP profile, e.g., "Thomas Olsson 0001" for https://dblp.uni-trier.de/pers/hd/o/Olsson_0001:Thomas

As far as I understand, the wrapper does not work for such names.

I'd love to see a solution to this issue!

@chinmaygarg13
Copy link

chinmaygarg13 commented Nov 10, 2019

Do the following changes in the init.py file:

def search(author_str): resp = requests.get(DBLP_AUTHOR_SEARCH_URL, params={'xauthor':author_str}) #TODO error handling root = etree.fromstring(resp.content) arr_of_authors = [] for urlpt in root.xpath('/authors/author/@urlpt'): resp1 = requests.get(DBLP_PERSON_URL.format(urlpt=urlpt)) xml = resp1.content root1 = etree.fromstring(xml) if root1.xpath('/dblpperson/homonym/text()'): for hom_urlpt in root1.xpath('/dblpperson/homonym/text()'): arr_of_authors.append(Author(hom_urlpt)) else: arr_of_authors.append(Author(urlpt)) return arr_of_authors

I tried to write the code indented here in this comment, but I don't know why it won't happen.
I hope you will be able to understand.
Though this method kills the purpose of loading data lazily, but it still solves the issue.

@mrksbrg
Copy link
Author

mrksbrg commented Nov 11, 2019

Hi, thanks for looking into this! It works for me, and I believe this will be good enough for my purpose.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants