mirror of
https://github.com/bellingcat/snscrape.git
synced 2026-06-10 19:38:29 +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)
|
||||
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
|
||||
yield from self._feed_to_items(feed)
|
||||
maxPosition = obj['min_position']
|
||||
|
||||
@classmethod
|
||||
|
||||
Reference in New Issue
Block a user