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