Questions tagged [xpathsapply]
7 questions
1
vote
1 answer
R XPATH strings contains element from a list
I m using R and the xpathSApply function to get elements from a web page that contains specific strings.
I m trying to use the contains function from xpath with several elements I stored in a list called my_list.
my_list <- c("word1", "word2",…

Remi
- 961
- 1
- 13
- 25
1
vote
0 answers
R: Large xml with string data in tags. Working with xmlEventParse + xpathSApply
I have lots of very large (>10GB) xml files in the following format:

km5041
- 351
- 1
- 4
- 13
0
votes
1 answer
whats the diff between the xpaths: (//a[@class="_2whKao"])[3] and //a[@class="_2whKao"][3]
Im getting 1 match with the fist xpath but 0 with the latter
I tried extracting an anchor tag using selenium by xpaths.

Anamitra Dey
- 3
- 1
0
votes
1 answer
Retriving parent attribute of every child in XML with xpathSApply
I'm trying to retrive two vectors of same length, one with attributes of childs, and second with attributes of corresponding parents. Example file:
countries.xml <- "
xxx…

Glomek
- 71
- 7
0
votes
1 answer
Using a variable in xpathSApply
Consider the following example of web scraping using R.
m <- "https://stackoverflow.com"
doc <- htmlParse(GET(m))
hello <- length(xpathSApply(doc, "//a/@href[contains(.,'stackoverflow')]"))
hello
[1] 48
The XPath function I use gives me the number…

Remi
- 961
- 1
- 13
- 25
0
votes
1 answer
Using xpathSApply to extract existing nodes but NA for missing?
I have the following xml:
parsed <-
0
votes
1 answer
Parse specific value from XML node
Using R and the XML package, I have parsed an ("HTMLInternalDocument" "HTMLInternalDocument" "XMLInternalDocument" "XMLAbstractDocument") object using the XML htmlParse function. The line in the xml object, see below, that I am interested in…

Jeffrey Evans
- 2,325
- 12
- 18