我正在尝试解析 html 网站,但不知何故我的代码不起作用。
testrun=htmlTreeParse("网站地址", useInternalNodes = T)
然后我得到...
<div class="md" > < p >我被误导了..< p > ...
我想抓住句子(我被误导了),所以我所做的是
xpathSApply(testrun,""//div[@class = 'md']//p", xmlGetAttr, "href")
但这会吐出 NULL 值。谁能告诉我我什么时候做错了?