Skip to main content

Web scraping of financial headlines

Project description

Newscraping

PyPI PyPI

This package makes webscraping of financial headlines easy.

Suported sources:

  • reuters.com/finance/markets
  • ft.com/markets

Installation

Newscraping can be installed from PyPI using pip or your package manager of choice:

pip install newscraping

Usage

CLI

You can use newscraping as a CLI tool using the newscraping command.
The package will get the latest headline from reuters and print is in the terminal.
This is mainly for testing purposes.

Python script

You can import the newscraping package in your python project using:

from newscraping import news

And then use it as:

df = news(newspaper="reuters", n_articles=-1, early_date="2020-01-01", verbose=0)
  • With the default parameters (see above), only the last headline from reuters will be returned
  • newspaper argument must be in ["reuters", "financial times"]
  • n_articles argument is the number of articles to return, starting with the most recent ones
  • early_date argument is the publication date of the earliest article to return
  • If both n_articles and early_date are provided, the script will stop scraping when the any condition is met
  • Pass verbose=1 to print in the progress of websraping (current page and publication date)

List of available sources

You can get the list of available sources this package is configured for calling:

from newscraping import newspapers
available_sources = newspapers()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

newscraping-0.1.2.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

newscraping-0.1.2-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file newscraping-0.1.2.tar.gz.

File metadata

  • Download URL: newscraping-0.1.2.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.3 CPython/3.8.5 Linux/4.19.128-microsoft-standard

File hashes

Hashes for newscraping-0.1.2.tar.gz
Algorithm Hash digest
SHA256 9cd259f01b46ed853b2d933c04acbebd6c3357e410e1943f4295a77192a03798
MD5 8652b03da876e249a8d4961cc26c9bee
BLAKE2b-256 b43c09af1120c9d81974c40519e4ead0e10900bc8eeba3abbc8002b8a84e6ae6

See more details on using hashes here.

File details

Details for the file newscraping-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: newscraping-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.3 CPython/3.8.5 Linux/4.19.128-microsoft-standard

File hashes

Hashes for newscraping-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 fb6f469d2e39dc149006782178b9a2dc65570df8aebc2cc9b62c12468658db83
MD5 fff0c1fd31226fdfb3335ea7b4f24517
BLAKE2b-256 ef8bb8f0724c450f672efabf56d7e6173967aaa8b9db6cdcf6fafe949e20304f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page