Skip to content

Allow paging #43

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

Open
norro opened this issue May 7, 2015 · 11 comments · May be fixed by #44
Open

Allow paging #43

norro opened this issue May 7, 2015 · 11 comments · May be fixed by #44

Comments

@norro
Copy link

norro commented May 7, 2015

Allow paging to receive results >20. Can be done with Google Scholar's search parameter 'start'.

norro pushed a commit to norro/scholar.py that referenced this issue May 7, 2015
* Since numer of results is limited to MAX_PAGE_RESULTS (20), the
 'start' parameter allows offsetting the search for paging.

fixes ckreibich#43
@norro norro linked a pull request May 7, 2015 that will close this issue
@andreas-wilm
Copy link

I thought after this patch iteration should be as easy as continuously calling querier.send_query(query) and updating query.start if len(querier.articles) == query.num_results and break otherwise. But that somehow lists results repeatedly up to a certain seemingly number...

Is there still a plan to implement iteration?

@willwhitney
Copy link

👍

@vext01
Copy link

vext01 commented Aug 2, 2016

I'd also like this feature

@floweri
Copy link

floweri commented Aug 22, 2016

how should start parameter set? I am not familiar with python. I would be appreciated If you could help.

@eknoes
Copy link

eknoes commented Aug 23, 2016

In the PR #44 it is not possible via the command line, just in your own code. After initializing your Query you have to use the method set_start.

query = SearchScholarQuery()
query.set_start(20)

@floweri
Copy link

floweri commented Aug 26, 2016

thanks. this is apart of my code:

if options.cluster_id: query = ClusterScholarQuery(cluster=options.cluster_id) else: query = SearchScholarQuery() query.set_start(20) if options.author: query.set_author(options.author) if options.allw: query.set_words(options.allw) if options.some:

but it has this error:

searchscholarquery does'nt have any attribute 'set_start'

@eknoes
Copy link

eknoes commented Aug 26, 2016

Yes, that is because this Pull Request is not merged yet and so it is not included in the main branch. You have to get the code from #44

@norro
Copy link
Author

norro commented Aug 29, 2016

Concerning the usage, @eknoes is right, SearchScholarQuery got the additional set_start() method. I usually first check, if paging is necessary:

if len(querier.articles) >= ScholarConf.MAX_PAGE_RESULTS:
  do_paging = True

and then, if paging is due:

query = SearchScholarQuery()
...
query.set_start(paging * ScholarConf.MAX_PAGE_RESULTS)

@floweri
Copy link

floweri commented Sep 2, 2016

I change to code according to commit and then add this number:
query.set_start(100)
MAX_PAGE_RESULTS = 100

but it find only 20 articles again.

@eknoes
Copy link

eknoes commented Sep 3, 2016

It will always find a maximum of 20 articles per page. You got article 100 to 120!

@floweri
Copy link

floweri commented Sep 3, 2016

No, i find only 20 articles at all.

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

Successfully merging a pull request may close this issue.

6 participants