0
我不知道如何使用XPathXPath来获取节点值
<div class="home_delivery_promo_banner"><span class="fleft"> <strong>Next day delivery (now includes Saturdays)</strong></span>
到目前为止,我已经写了下面的代码在节点中获得价值。
stock = xpathSApply(page,'//div[@class="home_delivery_promo_banner"]//span[@class="fleft"]//strong//text()',xmlValue,"class")
parenturl = "http://www.diy.com/nav/rooms/kitchens/handles-hinges/knob_handles/Cooke-and-Lewis-Dimpled-Knob-Pewter-Effect-9291589&bqrefcmp=AW&bqrefcre=AW_AFFILIATES"
srcpage = getURLContent(GET(parenturl)$url,timeout(10))
page = htmlParse(srcpage,useInternalNodes = T,encoding='UTF-8')
stock = xpathSApply(page,'//div[@class="home_delivery_promo_banner"]//span[@class="fleft"]//strong// text()',xmlValue,"class")
提前感谢
我不知道为什么它不适合我,我已经包括完整的代码。 – Savi