GoogleNews
Install
pip install GoogleNews
or
pip install --upgrade GoogleNews
Usage
- Initializing
from GoogleNews import GoogleNews
googlenews = GoogleNews()
- Optional choose language
googlenews = GoogleNews(lang='en')
- Optional choose period (period and custom day range should not set together)
googlenews = GoogleNews(period='7d')
- Optional choose custom day range (mm/dd/yyyy)
googlenews = GoogleNews(start='02/01/2020',end='02/28/2020')
- Optional set encode
googlenews = GoogleNews(encode='utf-8')
or
googlenews.set_lang('en')
googlenews.set_period('7d')
googlenews.set_time_range('02/01/2020','02/28/2020')
googlenews.set_encode('utf-8')
- news.google.com search sample
googlenews.get_news('APPLE')
- google.com section news search sample
googlenews.search('APPLE')
Default return first page result. To get other page of search results:
googlenews.get_page(2)
- Get results will return the list,
[{'title': '...', 'media': '...', 'date': '...', 'datetime': '...', 'desc': '...', 'link': '...', 'img': '...'}]
googlenews.results()
if googlenews.results(sort=True) the tool will try to order the results in cronologically reversed order
- Get texts will return the list of news titles
googlenews.get_texts()
- Get links returns the list of news links
googlenews.get_links()
- Clear result list before doing another search with the same object
googlenews.clear()
Issue
Image is not working in the latest version, it can only return default google loading gif
Metadata
Release files for GoogleNews 1.5.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| GoogleNews-1.5.1.tar.gz | 5.5 kB | Without provenance | Details for GoogleNews-1.5.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| GoogleNews-1.5.1-py3-none-any.whl | Python 3 | none | any | Details for GoogleNews-1.5.1-py3-none-any.whl |
Total release size: 12.2 kB
Release files / GoogleNews-1.5.1.tar.gz
| Download URL | GoogleNews-1.5.1.tar.gz |
|---|---|
| Size | 5.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
72acc7f983a314a19461a6378fd0e3650f1cfdd564efd67e90c2414930351bd6
|
|
BLAKE2b-256 checksum How to use checksums |
5cbb8300f14e6f08c3d54d3410f40bcb39629aec095d2b533668aaa032a7c7ff
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.52.0 CPython/3.9.0
|
Release files / GoogleNews-1.5.1-py3-none-any.whl
| Download URL | GoogleNews-1.5.1-py3-none-any.whl |
|---|---|
| Size | 6.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e48bba5eee0301a188650d46a6fd08b10c947df84d4d9266f441fe2dd24824ce
|
|
BLAKE2b-256 checksum How to use checksums |
4c2118c415bb8d54e84ece931b78bfc53090a2cf2841c90e34956c078cd1adb3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.52.0 CPython/3.9.0
|
Security for GoogleNews 1.5.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.