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
  • 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_search('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 = newspaper('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.9.tar.gz (5.0 kB view hashes)

Uploaded Source

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