Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5e6b0c5

Browse files
committed
in Gettinf and Cleaning Data corrected a bad exemple of path in xpathSApply exemple in extract content by attributes
1 parent dac33d0 commit 5e6b0c5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

3_GETDATA/Getting and Cleaning Data Course Notes.Rmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ $\pagebreak$
120120
* `xpathSApply(rootNode, "//price", xmlValue)` = get the values of all elements with tag "price"
121121
* **extract content by attributes**
122122
* `doc <- htmlTreeParse(url, useInternal = True)`
123-
* `scores <- xpathSApply(doc, "//li@class='score'", xmlvalue)` = look for li elements with `class = "score"` and return their value
123+
* `scores <- xpathSApply(doc, "//li[@class='score']", xmlvalue)` = look for li elements with `class = "score"` and return their value
124124

125125

126126

0 commit comments

Comments
 (0)