New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

twitter-webscraper

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

twitter-webscraper

A Twitter web scraper built with TypeScript and Puppeteer ## Installation To use this package in your project, run: ```bash npm i twitter-webscraper ``` ## Features - Log in to your Twitter account - Scrape tweets - Scrape user's information -

latest
Source
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

twitter-webscraper

A Twitter web scraper built with TypeScript and Puppeteer

Installation

To use this package in your project, run:

npm i twitter-webscraper

Features

  • Log in to your Twitter account
  • Scrape tweets
  • Scrape user's information
  • Scrape user's followers
  • Scrape user's following

To Implement

  • Search and Scrape top and latest tweets
  • Scrape logged in user's timeline
  • Scrape user's tweets

Usage

const { Scraper } = require('twitter-webscraper');
const scraper = new Scraper();

(async () => {
    // It will initialize the headless browser 
    await scraper.initializeBrowser();
    // It's not necessary to log in, but if you want to have access to
    // all of the features, then you need to log in.  
    await scraper.login('username or email', 'password');
    const userInfo = await scraper.getUserInfo('username');
    console.log(userInfo);
    // It will close the headless browser. 
    // You have to write this at the end of your code. 
    scraper.browser.close();
})();

Methods

MethodDescription
initializeBrowser()It will initialize the headless browser
login(username_or_email: string, password: string)Log in to your Twitter account
getUserInfo(username: string)Scrape information of the given user
getFollwers(username: string)Scrape followers of the given user
getFollwing(username: string)Scrape following of the given user
getTweet(link: string)Scrape the given tweet
browser.close()It will close the headless browser

Contributing

If you encounter a bug or you want to add new features, feel free to submit issues and enhancement requests.

  • Fork the repo on GitHub
  • Clone the project to your own machine
  • Commit changes to your own branch
  • Push your work back up to your fork
  • Submit a Pull request

Keywords

twitter webscraper

FAQs

Package last updated on 12 Aug 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts