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

Unlimit search result #12

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions itunes_app_scraper/scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ def get_app_ids_for_query(self, term, num=50, page=1, country="nl", lang="nl"):
Retrieve suggested app IDs for search query

:param str term: Search query
:param int num: Amount of items to return per page, default 50
:param int page: Amount of pages to return
:param int|None num: Amount of items to return per page, default 50
:param int|None page: Amount of pages to return
:param str country: Two-letter country code of store to search in,
default 'nl'
:param str lang: Language code to search with, default 'nl'
Expand All @@ -44,7 +44,10 @@ def get_app_ids_for_query(self, term, num=50, page=1, country="nl", lang="nl"):
url = "https://search.itunes.apple.com/WebObjects/MZStore.woa/wa/search?clientApplication=Software&media=software&term="
url += quote_plus(term)

amount = int(num) * int(page)
if num is None or page is None:
amount = None
else:
amount = int(num) * int(page)

country = self.get_store_id_for_country(country)
headers = {
Expand Down