我已經寫了以下行點擊獲取頁面所有鏈接,但點擊只有一個鏈接,並卡在那裏一下,我已經使用硒的Web驅動程序API:如何從獲取的所有鏈接點擊使用Selenium紅寶石
require 'rubygems'
require 'selenium-webdriver'
driver = Selenium::WebDriver.for :firefox
driver.get " http://www.testfire.net "
for i in 1..100
link = driver.find_element(:tag_name, "a")
link.click
end
告訴我如何跳過點擊鏈接並轉到下一個鏈接,或者可以將範圍設置爲1,直到它到達html頁面的末尾</html>
標記。 我認爲它會像eofpage = drive.find_element(:tag_name, "/html")
這幫助仍然需要做更多的工作在我身邊謝謝 – 2012-04-18 03:31:17