【发布时间】:2014-10-21 13:22:18
【问题描述】:
我正在尝试从以下 URL 中的 Steam 网站获取价格和游戏名称列表,但无法弄清楚 xpathSApply 应该如何解析以下内容:
http://store.steampowered.com/search/?sort_by=Price&sort_order=ASC&';">价格
这是我的代码
require(RCurl)
require(XML)
url <- "http://store.steampowered.com/search/results?sort_by=Name&sort_order=ASC&category1=1"
SOURCE <- getURL(url,encoding="UTF-8") #Download the page
substring (SOURCE,1,200)
PARSED <- htmlParse(SOURCE) #Format the html code
##My problem is in this line below
(xpathSApply(PARSED, "//div[@class='col search_price']"))
【问题讨论】:
标签: xml r xpath xml-parsing html-parsing