knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

newspaper

Travis build status AppVeyor build status

The goal of newspaper is to extract contents from Newspaper's website.

Installation

You can install the released version of newspaper from Github with:

# install.packages("remotes")
remotes::install_github("forkonlp/newspaper")

Example

This is a basic example which shows you how to solve a common problem:

library(newspaper)
library(stringr)

news <- np_news("http://www.segye.com/newsView/20190624511168")

news 

news$title
news$from
news$published_at
news$edited_at
news$by
news$body %>% 
  str_wrap(80) %>% 
  cat()

네이버 뉴스 스탠드 주요 언론사

library(tibble)
library(purrr)

target %>% 
  iwalk(
    ~ {print(.)
      purrr::safely(np_news)(.x) %>% 
      purrr::when(
        is.null(.$result) ~ invisible(.),
        ~ .$result %>% glimpse()
        )}
  )


forkonlp/newspaper documentation built on July 31, 2019, 8:40 a.m.