From 627877fb807c52317e8f3cd795c59810d4255eee Mon Sep 17 00:00:00 2001 From: Sebastian Kraus Date: Mon, 16 Jan 2017 12:08:18 +0900 Subject: [PATCH] baltimore-ravens updates @ xpathSApply The original commands only showed an empty list for "scores" and "teams". I fixed it. --- 03_GettingData/01_07_readingXML/index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/03_GettingData/01_07_readingXML/index.md b/03_GettingData/01_07_readingXML/index.md index 09f7539..beef385 100644 --- a/03_GettingData/01_07_readingXML/index.md +++ b/03_GettingData/01_07_readingXML/index.md @@ -226,8 +226,8 @@ xpathSApply(rootNode,"//price",xmlValue) ```r fileUrl <- "http://espn.go.com/nfl/team/_/name/bal/baltimore-ravens" doc <- htmlTreeParse(fileUrl,useInternal=TRUE) -scores <- xpathSApply(doc,"//li[@class='score']",xmlValue) -teams <- xpathSApply(doc,"//li[@class='team-name']",xmlValue) +scores <- xpathSApply(doc,"//div[@class='score']",xmlValue) +teams <- xpathSApply(doc,"//div[@class='game-info']",xmlValue) scores ```