GithubHelp home page GithubHelp logo

python-news-scraper's Introduction

Hacker News Article Scraper

This project is a Python script that scrapes articles from Hacker News and displays the best articles based on the number of votes. It utilizes the requests library to fetch the HTML content of the web pages and the BeautifulSoup library to parse and extract relevant information from the HTML. The scraped articles are then sorted by the number of votes and displayed using the pprint module.

Dependencies

To run this script, you need to have Python installed.

The project relies on the following Python libraries:

  • requests: You can install it by running pip install requests.
  • beautifulsoup4: You can install it by running pip install beautifulsoup4.
  • pprint: It is a built-in module in Python.

Make sure to install these dependencies before running the script.

Usage

  1. Open the Python script file scrape_hacker_news.py in your preferred IDE or text editor.
  2. Configure the number of pages you want to scrape by modifying the pages variable.
  3. Run the script using the following command:
python scrape_hacker_news.py
  1. Enter the number of pages you want to scrape when prompted.
  2. The script will scrape the articles, sort them by votes, and display the best articles.

Contributing

Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request in this repository.

python-news-scraper's People

Contributors

daafane-ilyass avatar

Stargazers

 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.