mirror of
https://github.com/bellingcat/snscrape.git
synced 2026-06-12 12:28:28 +03:00
Twitter: stop recursion based on whether the server returns the same position instead of detecting an empty feed
Fixes #37
This commit is contained in:
@@ -133,9 +133,10 @@ class TwitterSearchScraper(snscrape.base.Scraper):
|
|||||||
|
|
||||||
obj = json.loads(r.text)
|
obj = json.loads(r.text)
|
||||||
feed, _ = self._get_feed_from_html(obj['items_html'], False)
|
feed, _ = self._get_feed_from_html(obj['items_html'], False)
|
||||||
if not feed:
|
if feed:
|
||||||
|
yield from self._feed_to_items(feed)
|
||||||
|
if obj['min_position'] == maxPosition:
|
||||||
return
|
return
|
||||||
yield from self._feed_to_items(feed)
|
|
||||||
maxPosition = obj['min_position']
|
maxPosition = obj['min_position']
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|||||||
Reference in New Issue
Block a user