我有一个很长的网站列表,我想抓取它的title
、description
和keywords
.
我正在使用ContentScraper
from Rcrawler
package,并且我知道它可以正常工作,但是它无法执行某些 URL,只会生成下面的错误消息。无论如何它可以跳过那个特定的 URL 而不是停止整个执行?
Error: 'NULL' does not exist in current working directory
我看过这个,但我认为它没有任何答案。这是我正在使用的代码。任何意见是极大的赞赏。
Web_Info <- ContentScraper(Url = Websites_List,
XpathPatterns = c('/html/head/title', '//meta[@name="description"]/@content', '//meta[@name="keywords"]/@content'),
PatternsName = c("Title", "Description", "Keywords"),
asDataFrame = TRUE)