iwebbrowser2 对象的方法文档失败 [英] the method document of the iwebbrowser2 object failed

查看:51
本文介绍了iwebbrowser2 对象的方法文档失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我通过我的代码启动网站时,在我的变量oDoc"级别出现对象 iwebbrowser2 的方法文档失败"类型的错误

When I launch the site via my code, there is an error of type "method document of object iwebbrowser2 failed " at the level of my variable "oDoc"

Private Function CreerNavigateur(ByVal mails As String)
Dim IE As Object
Dim oDoc As Object
Dim Htable, maTable As Object
Dim text As String
Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = False
IE.navigate "https://csrtool-ssl.sso.infra.ftgroup/csrtool_web/Bricks/pg/osuit/pages/identity/IdentityAccountAndUsers?type=emailAlias&value=" & mails & "&tab_main=AccountInfo"
While IE.Busy Or IE.ReadyState <> READYSTATE_COMPLETE: DoEvents: Wend
    Set oDoc = IE.Document
    Set Htable = oDoc.getElementsByTagName("div")(1)
   ' MsgBox Htable.innerhtml
    Set maTable = Htable.getElementsByTagName("span")
    'MsgBox maTable(0).href
    'myData = maTable(0).innertext
    'MsgBox (myData)
    IE.Quit
    'On libère les variables
    Set IE = Nothing
    Set oDoc = Nothing
End Function

谢谢你帮助我看到我的错误

thank you for helping me to see my mistake

推荐答案

此类错误的可能原因之一是安全限制.尝试将 infra.ftgroup 添加到 IE 设置中的受信任站点区域:

One of the possible reasons of such errors are security restricitions. Try to add infra.ftgroup to Trusted sites zone in IE settings:

也尝试在兼容性视图中打开网站:

Also try to open the website in compatibility view:

并在开发者工具 F12 - 仿真选项卡上玩一些模式:

And play a bit with modes on Developer tools F12 - Emulation tab:

这篇关于iwebbrowser2 对象的方法文档失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆