Best Twitter Scraper avatar
Best Twitter Scraper
Try for free

No credit card required

View all Actors
Best Twitter Scraper

Best Twitter Scraper

zhangzhenhu/best-twitter-scraper
Try for free

No credit card required

Twitter scraper that scrapes the latest Twitter content of any user. Since you need to be logged in to Twitter to crawl, you need to provide a Twitter account. Twitter 抓取器,可以抓取任意用户最新的Twitter内容。 因为需要先登录 Twitter 才能抓取,所以需要提供一个 Twitter 的账号。

The code examples below show how to run the Actor and get its results. To run the code, you need to have an Apify account. Replace <YOUR_API_TOKEN> in the code with your API token, which you can find under Settings > Integrations in Apify Console. Learn more

1from apify_client import ApifyClient
2
3# Initialize the ApifyClient with your Apify API token
4client = ApifyClient("<YOUR_API_TOKEN>")
5
6# Prepare the Actor input
7run_input = {
8    "login_user": "HuZhang18851",
9    "login_password": "r7pkkp22",
10    "names": ["elonmusk"],
11    "tweet_urls": [],
12    "search_urls": [],
13}
14
15# Run the Actor and wait for it to finish
16run = client.actor("zhangzhenhu/best-twitter-scraper").call(run_input=run_input)
17
18# Fetch and print Actor results from the run's dataset (if there are any)
19print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
20for item in client.dataset(run["defaultDatasetId"]).iterate_items():
21    print(item)
22
23# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start
Developer
Maintained by Community
Actor metrics
  • 28 monthly users
  • 1 star
  • 10.2% runs succeeded
  • 6.8 days response time
  • Created in Aug 2023
  • Modified 11 months ago
Categories