【发布时间】:2011-07-19 00:09:13
【问题描述】:
我遇到的问题是我似乎找不到如何获取 Bowser.text.include?查找我在程序前面给出的 textinclude 的值。
似乎按字面意思搜索#{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
感谢您的帮助。
谢谢
【问题讨论】:
标签: ruby variables text find watir