require 'watir-webdriver'
require 'iconv'  
cov = Iconv.new( 'gbk', 'utf-8')     

b = Watir::Browser.new 


b.cookies.clear

b.goto("http://www.hao123.com")
  

#t = b.text_field :class => 'input input-hook'
#t.exists?
#t.set 'your name'
#t.value



a=b.button(:class=>'button button-hook').attribute_value("value")
 
puts cov.iconv("#{a}")

puts b.link(:xpath=>'//*[@>).text()

#b.span(:xpath=>'//*[@]/div[1]/span[5]').flash

#puts b.span(:class=>"g-fc2 copyright").text



#attribute_value("value")

#puts #{a}
#
#a.flash
#t.set 'ddd'

 

相关文章:

  • 2021-06-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-08
  • 2021-12-11
  • 2022-02-27
  • 2021-08-07
  • 2021-06-29
猜你喜欢
  • 2021-12-12
  • 2021-11-28
  • 2021-11-17
  • 2021-09-17
  • 2021-08-11
  • 2021-12-18
  • 2021-07-08
相关资源
相似解决方案