Git Product home page Git Product logo

medium-crawler's Introduction

medium-crawler

A crawler for scraping posts from Medium

Dependencies

python3 is required along with pip3 (mine is pip by default).

First clone this repo:

git clone https://github.com/NISH1001/medium-crawler

Install using requirements.txt:

pip install -r requirements.txt

Webdriver

Since the crawler uses selenium driver (more specifically, a headless driver), be sure to have firefox or chrome installed in your system. You can always change it in the code if you feel like.
The web drivers should be in the system path like: /usr/bin/ or /usr/local/bin/

Firefox requires geckodriver. Download the executable to geckodriver and put it in the system path.
Similar process might apply for Chrome or Chromium.

If nothing works out, you can put the path in the constructor here
(Kind of manual override :D) Like:

self.driver = webdriver.Chrome(path_to_web_driver)

Usage

The crawler requires username, dump type and the directory where data is to be dumped.

help me

python mcrawler.py -h
usage: mcrawler [-h] -u USER -t TYPE -dd DUMP_DIR

Crawl Posts from medium

optional arguments:
  -h, --help            show this help message and exit
  -u USER, --user USER  The username for medium
  -t TYPE, --type TYPE  The format for dumping -> text, json
  -dd DUMP_DIR, --dump-dir DUMP_DIR
                        The directory where the data is to be dumped

example

python mcrawler.py -u nishparadox -t text -dd data/

medium-crawler's People

Contributors

nish1001 avatar radomirbosak avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.