在 vba 中使用 xmlhttprequest,如何获取未在初始请求中加载的元素

问题描述

我正在尝试使用 vba 中的 xmlhttprequests 与 Microsoft 团队的聊天屏幕进行交互。我是 xmlhttprequest (xmlhr) 的新手,我被困在大部分页面已加载但聊天窗口未加载的地方。我可以使用 .getelementbyid 来获取 flex-fill 元素,但它在 responseText 中没有 div 或任何消息。

我假设它正在等待内部框架加载或可见,但我不知道如何在不使用新的 xmlhttprequest 的情况下调用第二个请求。

我正在使用:

Dim myUrl as string
MyUrl = "https://teams.microsoft.com/_?tenantid=xxxxx"
Dim xmlhttp as new MSXML2.xmlhttp60
Xmlhttp.open "get",myUrl,false
Xmlhttp.setrequestheader "content-type","Application/xml"
Xmlhttp.send

Dim html as new htmldocument
Html.body.innerhtml = xmlhttp.responsetext
Set testing = html.getelementbyid(=page-content-wrapper")
'this works fine but there are no children past the next child

当我查看站点的开发人员工具时,消息在此元素中,但在 xmlhttprequest 中,我只能看到聊天窗口的最外框。

任何帮助将不胜感激。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)