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

Incosistency when searching for publications #549

Open
NisoD opened this issue Sep 15, 2024 · 0 comments
Open

Incosistency when searching for publications #549

NisoD opened this issue Sep 15, 2024 · 0 comments
Labels

Comments

@NisoD
Copy link

NisoD commented Sep 15, 2024

Describe the Bug

I encountered an inconsistency when searching for publications by title. The search behavior is unpredictable: sometimes it returns results, and other times it doesn't, depending on how the session is restarted.

To Reproduce

Steps to reproduce the behavior:

  1. Attempt to search for a specific publication by title using iPython.
  2. Observe that in some cases, results are returned, while in others (after restarting the session), no results are found.

Expected Behavior

The expected behavior is to receive consistent search results every time the query is run, regardless of whether the session is restarted.

Desktop:

  • Proxy Service: FreeProxies
  • Python Version: 3.11
  • Operating System: macOS
  • Library Version: 1.5

Possible Fix

The issue might be in the _load_url function located in publication_parser.py. I suggest changing the following line:

self._rows = self._soup.find_all('div', class_='gs_r gs_or gs_scl') + self._soup.find_all('div', class_='gsc_mpat_ttl')

to:

self._rows = self._soup.select("div.gs_r.gs_or.gs_scl") + self._soup.select("div.gsc_mpat_ttl")

This should potentially improve the consistency of search results.

@NisoD NisoD added the bug label Sep 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant