以下是代码......
require 'watir'
@ie = Watir::IE.new
@ie.goto 'http://asdfasdf.com'
begin
@ie.check_for_http_error
rescue Watir::Exception::NavigationException => e
puts "Page did not load: #{e}"
end
require 'watir/contrib/page_checker'
@ie.add_checker(PageCheckers::NAVIGATION_CHECKER)
begin
@ie.goto "http://marekj.com/asdfasdfasdfa"
rescue Watir::Exception::NavigationException => e
puts "Page did not load: #{e}"
end
我运行上面的代码,但它显示错误消息:
c:/ruby192/lib/ruby/gems/1.9.1/gems/watir-2.0.3/lib/watir/page-container.rb:12:in `method_missing': (in OLE method `navigator': ) (WIN32OLERuntimeError)
OLE error code:80070005 in <Unknown>
Access is denied.
HRESULT error code:0x80020009
Exception occurred.
from c:/ruby192/lib/ruby/gems/1.9.1/gems/watir-2.0.3/lib/watir/page-container.rb:12:in `check_for_http_error'
from xception.rb:7:in `<main>'
我该如何解决这个问题?
答案 0 :(得分:1)
Access is denied.
错误消息通常是帧的问题。 Google提供该错误消息。