Web scraping of financial headlines
Project description
Newscraping
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9cd259f01b46ed853b2d933c04acbebd6c3357e410e1943f4295a77192a03798 |
|
MD5 | 8652b03da876e249a8d4961cc26c9bee |
|
BLAKE2b-256 | b43c09af1120c9d81974c40519e4ead0e10900bc8eeba3abbc8002b8a84e6ae6 |
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | fb6f469d2e39dc149006782178b9a2dc65570df8aebc2cc9b62c12468658db83 |
|
MD5 | fff0c1fd31226fdfb3335ea7b4f24517 |
|
BLAKE2b-256 | ef8bb8f0724c450f672efabf56d7e6173967aaa8b9db6cdcf6fafe949e20304f |