Giter VIP home page Giter VIP logo

berita-crawler's Introduction

berita-crawler

a simple and extensible Indonesian Index News Crawler

Online Media List :

Requirements :

  • BeautifulSoup4
  • requests

How To Use :

Setup VirutalEnv

I recommend you to use virutalenv, but this is completely optional

  • on python > 3.x :

    virtualenv main

    on python > 3.3 :

    python -m venv main

  • activate the virutalenv :

    source main/bin/activate

  • deactivate the virtualenv:

    deactivate


Using the Program

  • Install Requirements

    pip install -r requirements.txt

  • Open / Create main.json files

    this files is used to determine what task the program will do (see more here)

  • Run the program

    python -m main

JSON Files

this program use a simple json file to determine from which source it needs to take.

a template under the name main.json is already available. You can use it as a base.

Task

    "tasks" : [
        {
            "src":"detik",
            "target_length":5,
            "start_date": "29/3/2021"
        }
    ]

available parameter

params required options description default
src required "detik", "liputan6", "cnnIndo", "kompas", "tempo", "turnbackhoax" the source of the news
target_length required how many news is crawled
start_date optional the start date of the news (format dd/mm/yyyy) system date (datetime.now())
end_date optional the maximum date of the news (format dd/mm/yyyy) system date (datetime.now())

Output

    "output": {
        "type": "csv",
        "name": "result.csv"
    }

available parameter

params required options description default
type required "csv" the output file type
name optional the output file name "output.csv"

berita-crawler's People

Contributors

aufamiri avatar dependabot[bot] 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.