get_text: Get BBC News article

Description Usage Arguments Value Note Examples

View source: R/GetText.R

Description

Scrap article headline and body text from BBC News website (https://www.bbc.com/news/), merge them together and create a Corpus for text mining.

Usage

1
get_text(url_end)

Arguments

url_end

character string, an ending part of BBC News particular atricle URL (everything after https://www.bbc.com/news/). For example, article URL is "https://www.bbc.com/news/world-us-canada-51381625". Only "world-us-canada-51381625" should be pasted

Value

art_c - Corpus representing a collection of text documents with an article text (each article paragraph as a single document in Corpus)

Note

Please, check that URL (url_end) exists before running the function, otherwise you will get an "Error in open.connection(x, "rb") : HTTP error 404". Please, insert URLs of the articles in English only. Only for BBC News, not BBC Sports , Travel, Worklife, etc.

Examples

1
2
get_text("world-us-canada-51381625")
get_text("entertainment-arts-35232060")

unimi-dse/1ed5ff0d documentation built on Feb. 10, 2020, 12:21 a.m.