Skip to content
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

Scraping only 4 tweets no matter the tweet count #49

Open
Orski174 opened this issue Nov 14, 2022 · 1 comment
Open

Scraping only 4 tweets no matter the tweet count #49

Orski174 opened this issue Nov 14, 2022 · 1 comment

Comments

@Orski174
Copy link

Orski174 commented Nov 14, 2022

As mentioned in the title, I'm getting only 4 tweets using this code

from twitter_scraper_selenium import scrape_profile
import os
import json
account = input("Account: ")
tweets = int(input("How many tweets: "))
path = os.path.join(parent_dir, account)
if os.path.exists(path) == False:
    os.mkdir(path)
data = scrape_profile(twitter_username=account, output_format="json", browser="firefox", tweets_count=tweets)
print(data)
parsed = json.loads(data)
json_data = json.dumps(parsed, indent=4)
with open(path + "\\" + account + ".json", "w") as outfile:
    outfile.write(json_data)

And this is the print output: https://pastebin.com/p1UuxZFa

Thank you.

@shaikhsajid1111
Copy link
Owner

I see, I think there might be some sort of update on front end side of the Twitter. I'm currently unavailable for pushing out fix so I would suggest to use scrape_keyword_with_api function with query built from here which will filter out tweets specifically posted by the given username. Example query could be something like from:BarackObama

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants