0
我有它在腳本登錄並進入瀏覽器url的地方,但是當它退出當前網頁時,它只是坐在那裏,不會重新啓動循環。我如何獲得循環來實現完成並重啓?如何讓我的腳本循環?
x = 0
while x <= 5
File.open("yahoo_accounts.txt") do |email|
email.each do |item|
email, password = item.chomp.split(',')
emails << email
passwords << password
emails.zip(passwords) { |name, pass|
browser = Watir::Browser.new :ff
browser.goto "url"
#logs in and does what its suppose to do with the name and pass
}
end
x += 1
next
end
end
當腳本完成它只是坐在在網頁...我試圖讓它去再次開始...... 你可能會認爲它會採取每一個名字,通過去回到開始的url。 感謝您的幫助。
當我在我的腳本中使用browser.close時,它會阻止它完全運行 – marriedjane875
所以最後一部分而不是browser.close我只是退出該網站。 – marriedjane875
看到我最新的編輯,你肯定會產生大量的實例,這些實例在我的機器上打開了大量的瀏覽器窗口,並且快速地失控。看看是否有幫助。 – wmjbyatt