Skip to main content

A Python Package which helps to scrape news details

Project description

PyPI Version Coverage Status License Documentation Status

news_fetch

news_fetch scrape all the news related attributes with helps Google Search and Newspaper3K which reduce the NaN or '' or [] or None values while scraping.

Source Link
PyPI: https://pypi.org/project/news_fetch/
Repository: https://santhoshse7en.github.io/news_fetch/
Documentation: https://santhoshse7en.github.io/news_fetch_doc/

Dependencies

  • beautifulsoup4
  • selenium
  • chromedriver-binary
  • fake_useragent
  • pandas
  • nltk
  • pattern

Dependencies Installation

Use the package manager pip to install following

pip install -r requirements.txt

Usage

Download it by clicking the green download button here on Github. To extract URLs from targeted website call google_crawler function, you only need to parse argument of keyword and newspaper website.

>>> from news_fetch.news import google_search
>>> google = google_crawler('Alcoholics Anonymous', 'https://timesofindia.indiatimes.com/')

Directory of google search results urls

google

To scrape the all news details call news_crawler function

>>> from news_fetch.news import newspaper
>>> news = news_crawler('https://www.bbc.co.uk/news/world-48810070')

Directory of news_crawler

news

>>> news.headline

'g20 summit: trump and xi agree to restart us china trade talks'

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

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

news_fetch-0.0.2.tar.gz (4.6 kB view details)

Uploaded Source

File details

Details for the file news_fetch-0.0.2.tar.gz.

File metadata

  • Download URL: news_fetch-0.0.2.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

File hashes

Hashes for news_fetch-0.0.2.tar.gz
Algorithm Hash digest
SHA256 e6b44887cb915d704126e888642b1ef290c9d8b57d2185b81500db44f1529785
MD5 09d9e70cfbeb23cf7b130ddb41e74d17
BLAKE2b-256 2e1550e65ff3d95415fd113048ecfef9fb0cdadb9b83723ab2af7b5e72a2c894

See more details on using hashes here.

Supported by

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