JustAnotherArchivist / snscrape

A social networking service scraper in Python

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

module 'snscrape.utils' has no attribute 'TwitterSearch'

elieayoubit opened this issue · comments

Describe the bug

  1. Versions : Python 3.10.12, and snscrape 0.7.0.20230622

  2. Imported Library : import snscrape.modules.twitter as sntwitter

  3. Using : tweets = sntwitter.TwitterSearch(query=search_term, max_results=max_results, since=since_date, until=until_date)

  4. Error: module 'snscrape.utils' has no attribute 'TwitterSearch'

  5. 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

image

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.