나는 아톰 피드와 각 기사 링크를 가져 오는 데 문제가있는 R 스크레이퍼를 만들고 있습니다. 여기에 내 코드가있다 :R 스크랩 아톰 피드를 데이터 프레임에 넣기
url <- "http://www.stwnewspress.com/search/?mode=article&q=&nsa=eedition&t=article&l=1000&s=&sd=desc&f=atom&d=&d1=&d2="
pageSource <- getURL(url, encoding = "UTF-8")
parsed <- htmlParse(pageSource)
titles <- xpathSApply(parsed, '//entry/title', xmlValue)
authors <- xpathSApply(parsed, '//entry/author', xmlValue)
links <- xpathSApply(parsed, '//entry/link/@href')
dataFrame <- data.frame(pubDates, titles, authors)
내 문제는 18 권의 저자, 18 명의 저자, 20 개의 링크가있다. 피드 페이지에서 처음 두 개의 링크를 가져 오는 것 같지만, 그만 두는 방법을 모르겠습니다.
도움 주셔서 감사합니다.
[R does RSS] (https://github.com/noahhl/r-does-rss)를 사용해 볼 수도 있습니다. ad @ jdharrison의 답변 – hrbrmstr