module 'snscrape.utils' has no attribute 'TwitterSearch'
elieayoubit opened this issue · comments
Describe the bug
-
Versions : Python 3.10.12, and snscrape 0.7.0.20230622
-
Imported Library : import snscrape.modules.twitter as sntwitter
-
Using : tweets = sntwitter.TwitterSearch(query=search_term, max_results=max_results, since=since_date, until=until_date)
-
Error: module 'snscrape.utils' has no attribute 'TwitterSearch'
-
I already tried updating snscrape, uninstalling and reinstalling
How to reproduce
import snscrape.modules.twitter as sntwitter
import pandas as pd
search_term = "any term"
max_results = 100
# Optional: Filter by date
since_date = "2024-02-01"
until_date = "2024-04-01"
tweets = sntwitter.TwitterSearch(query=search_term, max_results=max_results, since=since_date, until=until_date)
Expected behaviour
import
Screenshots and recordings
Operating system
Windows 10 Pro
Python version: output of python3 --version
Python 3.10.12
snscrape version: output of snscrape --version
snscrape 0.7.0.20230622
Scraper
How are you using snscrape?
Module (import snscrape.modules.something
in Python code)
Backtrace
module 'snscrape.utils' has no attribute 'TwitterSearch'
Log output
No response
Dump of locals
No response
Additional context
No response
TwitterSearch
has never existed. TwitterSearchScraper
does, but it's broken (see other open issues).
I will leave this issue open though because there is a bug here: the error should refer to snscrape.modules.twitter
, not snscrape.utils
.