I’m trying to parse html website but somehow my code doesn’t work.
testrun=htmlTreeParse(“website address”, useInternalNodes = T)
then I get…
< div class=”md” >
< p >I was misinformed..< p >
…
I wanted to grab the sentence (I was misinformed), so what I did was
xpathSApply(testrun,””//div[@class = ‘md’]//p”, xmlGetAttr, “href”)
but this spits out NULL value.. Can anyone tell me when I did wrong here?
Use
xmlValue.xmlGetAttrcallsxmlAttrsand is used to return attributes of a node.