0
的索引列表下面是HTML的例子:的XPath RSelenium的值
<li class="index i1"
<ol id="rem">
<div class="bare">
<h3>
<a class="tlt mhead" href="https://www.myexample.com">
<li class="index i2"
<ol id="rem">
<div class="bare">
<h3>
<a class="tlt mhead" href="https://www.myexample2.com">
我想利用每一個HREF的值在元素中。是什麼讓名單變成第一個李的班級,其中班級的名字改變了i1,i2。 所以我有一個櫃檯,當我去拿價值的時候改變它。
i <- 1
stablestr <- "index "
myVal <- paste(stablestr , i, sep="")
因此即使嘗試只用這個
profile<-remDr$findElement(using = 'xpath', "//*/input[@li = myVal]")
profile$highlightElement()
或HREF使用該
profile<-remDr$findElement(using = 'xpath', "/li[@class=myVal]/ol[@id='rem']/div[@id='bare']/h3/a[@class='tlt']")
profile$highlightElement()
這有什麼錯用的XPath指數設爲myVal訪問一般的lib?
謝謝。在Rselenium中,xpath的語法可能有點不同? – Elen
也許吧。我對RSelenium一無所知,我只是假設我們正在談論XPath,它符合規範。 – flyx