到目前为止我有这个:
require 'watir-webdriver'
require 'date'
require 'nokogiri'
browser = Watir::Browser.start 'https://example/ViewReport.aspx'
browser.link(:text, 'Combined Employee Performance Report').click
today = Date.today
yesterday = today.prev_day.strftime('%m' '%d' '%Y')
t = browser.text_field :id => 'UC255_txtStart'
t.set yesterday
t = browser.text_field :id => 'UC255_txtEnd'
t.set yesterday
btn = browser.button :value, 'Run Report'
btn.exists?
btn.click
page = Nokogiri::HTML.parse('browser')
links = page.css("a")
puts links.length
当我尝试解析browser
Watir 用于站点 URI 的变量时,它给了我一个空白的 HTML 页面。