Zeeshanahmad4 / Tweets-Scraper-twitter-Selenium

Recently twitter has stopped giving thier Apis to everyone, So i write simple Python script using selenium to scrap all the tweets from a user and store into a csv file
MIT License
19 stars 11 forks source link

AttributeError: 'WebDriver' object has no attribute 'find_element_by_css_selector' #1

Open Adefebrian opened 2 months ago

Adefebrian commented 2 months ago

~/Downloads/roasting wkw/wallet-net-worth/wallet-net-worth/scrapx  main !2 ?2   14s ❯ python3 main.py ^[^[Traceback (most recent call last): File "/Users/adefebrian/Downloads/roasting wkw/wallet-net-worth/wallet-net-worth/scrapx/main.py", line 23, in driver.find_element_by_css_selector(".u-size2of3").click() AttributeError: 'WebDriver' object has no attribute 'find_element_by_css_selector'

~/Downloads/roasting wkw/wallet-net-worth/wallet-net-worth/scrapx  main !2 ?2   60s ❯

mishania1996 commented 2 months ago

find_elements_by_css_selecto method has been deprecated in recent versions of Selenium. Instead, you should use the find_elements() method with the appropriate By class.

But even then, you cannot scrape because now you have to log in. And whenever you log in, twitter finds a way to detect that the requests are automated and blocks the requests.