fix pagination in scraper
This commit is contained in:
parent
78a0843758
commit
5ae8a8bcfd
1 changed files with 1 additions and 1 deletions
|
@ -38,7 +38,7 @@ def getpage(url):
|
||||||
pagecount = 1
|
pagecount = 1
|
||||||
for link in resp.links.values():
|
for link in resp.links.values():
|
||||||
if link['rel'] == 'last':
|
if link['rel'] == 'last':
|
||||||
pagecount = int(re.search('page=(.+?)', link['url']).group(1))
|
pagecount = int(re.search('page=(.+)', link['url']).group(1))
|
||||||
|
|
||||||
val = resp.json()
|
val = resp.json()
|
||||||
if not isinstance(val, list):
|
if not isinstance(val, list):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue