
Best Twitter Scraper
zhangzhenhu/best-twitter-scraper
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 mode
import { ApifyClient } from 'apify-client';
// Initialize the ApifyClient with API token
const client = new ApifyClient({
token: '<YOUR_API_TOKEN>',
});
// Prepare Actor input
const input = {
"login_user": "HuZhang18851",
"login_password": "r7pkkp22",
"names": [
"elonmusk"
],
"tweet_urls": [],
"search_urls": []
};
(async () => {
// Run the Actor and wait for it to finish
const run = await client.actor("zhangzhenhu/best-twitter-scraper").call(input);
// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
console.dir(item);
});
})();
Developer
Maintained by Community
Actor stats
- 213 users
- 543 runs
- Modified 3 months ago
Categories