私が抱えている問題は、Bowser.text.includeを取得する方法を見つけることができないということです。 textincludeの値を調べるために、私がプログラムでこれを早く与えることをお勧めします。Browser.text.includeを取得するにはどうすればよいですか?変数を検索するには? (WatirとRubyを使用)
#{textinclude}は文字通り検索されているようですが、これは明らかに存在しません。
print('Enter your website: ')
website = gets()
puts("Testing #{website}")
print('What text do you want to find? ')
textinclude = gets()
puts("Finding #{textinclude}")
require 'watir'
browser = Watir::IE.new
browser.goto (website)
if browser.text.include? " #{textinclude} "
print("#{textinclude} present")
else
print("text not present")
end
あなたの助けに感謝:
これは私の現在のコードです。
おかげ
私はこれをウェブサイトwww.google.comでテストし、Googleホームページの右上に表示される「高速」という言葉を検索しています。 – anonygoose
これは....すごいですね。どうもありがとうございました。 :) – Benjamin