b =Watir::IE.new
b.goto'http://www.google.com/'
txt =b.element_by_xpath("//*[@name='q']")
txt.value= 'Richard Lawrence'
btn =b.element_by_xpath("//*[@name='btnG']")
btn.click

@b.elements_by_xpath("//div[@class='UserServiceValues']").each do |elem|
puts elem.innerText
end
 
defelement_count(element_type, attribute, value)
   return$ie.elements_by_xpath("//#{element_type}[@#{attribute}='#{value}']").length
end
puts element_count("div","class", "font10px titleColumn")

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-26
  • 2022-12-23
  • 2021-08-25
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-30
相关资源
相似解决方案