<a href="/app1/data/r.doc"> foo </a>
<a href="/app2/data/r.doc"> boo </a>
<a href="/app3/data/r.doc"> loo </a>
<a href="/app3/data/r.doc"> goo </a>
從下面html
一部分,我必須找出3日最後text
的......我們的訪問,我寫了下面的代碼(used selenium-webdriver
):那麼現在如何獲得如何使用selenium-webdriver獲得第三個值boo?
all_links=driver.find_elements :tag_name, "a"
all_links.each do|link|
puts link.attribute("href")
puts link.text()
end
第三個值boo
使用selenium-webdriver
?我在上面告訴第三個foo
可能還有100個以上。
有什麼建議嗎?
Wooooooooooowwwwww !!完美'+ 1'給你,並接受!' – DoLoveSky