-
-
Notifications
You must be signed in to change notification settings - Fork 221
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scrape not working? #163
Comments
I also encountered the same problem. |
Is the same thing happening to other scrapers? Might want to keep an eye. |
It's twitter's new restriction, now you need to login before searching.
|
Can you explain a bit more on how and what are we supposed to change. |
In Your Code (Add Your Twitter Account to .env File In Advance) from Scweet.scweet import scrape
from Scweet.utils import init_driver, log_in
driver = init_driver(headless=True, show_images=False, proxy="your_proxy_setting")
log_in(driver, env=".env")
data = scrape(..., driver=driver) In scrape() of scweet.py def scrape(..., driver=None):
......
# Remove This Line (71)
# driver = init_driver(headless, proxy, show_images) |
It works! Thanks. |
Hi, I am new to this, could you tell where do I add .env file? Thanks |
It should be in your project's folder (NOTE: the file name should be '.env'). Your '.env' should be in the format given below:
Below are the steps and changes I have made:
NOTE: My method is not robust. If you can find a better way to scrape tweets, let us know. |
In scrape() of 'scweet.py': |
Hello, I am new to this too, could you tell where can I attain the "your_proxy_setting"? Thanks very much! |
Try following the method I have given above. It works for me. Note: I have to restart my VScode every time I make a change in the Scweet library. |
@Wish-s |
Thank you for your reply. I need a a proxy(or VPN) to connect to twitter.com, but I can't find where to obtain the parameter. |
@Wish-s |
hello guy this is my code from selenium import webdriver Specify the parameters for scrapingusername = "2MInteractive" Set up the ChromeDriver serviceservice = Service("C:/Users/HP Probook/Downloads/chromedriver.exe") # Replace with the actual path to chromedriver Set up the ChromeOptionsoptions = webdriver.ChromeOptions() Create the WebDriverdriver = webdriver.Chrome(service=service, options=options) Scrape the tweets by usernamedata = scrape(from_account=username, since=since_date, until=until_date, headless=headless, driver=driver) Print the scraped dataprint(data) Close the WebDriverdriver.quit() |
check this solution, it might work if none of the others worked #169 (comment) |
I wasn't getting any results from scrape, so I tried with headless=False. I noticed that search wasn't returning any results, I assume since you need an account to search. I confirmed that the links work in my browser where I'm signed in. Will the script be fixed, or am I missing something? Thanks.
The text was updated successfully, but these errors were encountered: