1.0.4 • Published 6 months ago
scrape-tweets v1.0.4
scrape-tweets
A Node.js package to scrape tweets using Selenium WebDriver.
Installation
Install the package via npm:
npm install scrape-tweets
Usage
Here's an example of how to use the package:
const scrapeTweets = require('scrape-tweets');
(async () => {
const username = 'atulit_gaur';
console.log(`Scraping tweets from @${username}...`);
try {
const tweets = await scrapeTweets(username, 10); // here 10 is the number posts you wanna extract, default is 20
console.log('Tweets:', tweets);
} catch (error) {
console.error('Error scraping tweets:', error.message);
}
})();
Features
- Scrape tweets from any public Twitter profile.
- Handles login walls and retries.
- Saves tweets to a JSON file.
License
MIT