Skip to main content

A python package to get news from BBC.

Project description

BBCNews

A python package to get news from BBC.

Installation

pip3 install BBCHeadlines

Usage

Print headlines:

# Import BBCHeadlines
from BBCHeadlines import articles

# Print the title of article #article_num five times. article_num increases by one every time the loop is increased, starting at zero.
for article_num in range (5):
    print(articles.title()[article_num])

Print info on first article:

# Import library
from BBCHeadlines import articles
# We'll get info on the first article
article_num = 0

# Print article title
print('Title: ' + articles.title()[article_num])
# Print article description
print('Description: ' + articles.description()[article_num])
# Print article link
print('Link: ' + articles.link()[article_num])

We can put this into a loop to get headlines with info on the articles:

# Import library
from BBCHeadlines import articles

# Print info on article #article_num five times. article_num increases by one every time the loop is increased, starting at zero.
for article_num in range (5):
    # Print article title
    print('Title: ' + articles.title()[article_num])
    # Print article description
    print('Description: ' + articles.description()[article_num])
    # Print article link
    print('Link: ' + articles.link()[article_num])

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

BBCHeadlines-2.tar.gz (1.7 kB view hashes)

Uploaded Source

Built Distribution

BBCHeadlines-2-py3-none-any.whl (2.9 kB view hashes)

Uploaded Python 3

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