ExcelHome技术论坛

 找回密码
 免费注册

QQ登录

只需一步,快速开始

快捷登录

搜索
EH技术汇-专业的职场技能充电站 妙哉!函数段子手趣味讲函数 Excel服务器-会Excel,做管理系统 效率神器,一键搞定繁琐工作
HR薪酬管理数字化实战 Excel 2021函数公式学习大典 Excel数据透视表实战秘技 打造核心竞争力的职场宝典
让更多数据处理,一键完成 数据工作者的案头书 免费直播课集锦 ExcelHome出品 - VBA代码宝免费下载
用ChatGPT与VBA一键搞定Excel WPS表格从入门到精通 Excel VBA经典代码实践指南
查看: 415|回复: 0

[求助] 在githua发现一个控制EDGE的方法。搞半天不懂处理alert.大佬来看下

[复制链接]

TA的精华主题

TA的得分主题

发表于 2023-4-1 03:26 | 显示全部楼层 |阅读模式

主要是想获取弹窗里的内容和关闭弹窗
附件搞上来了
Examples.zip (1.5 MB, 下载次数: 8)


下面是描述(搬自PerditionC)
VBAChromeDevProtocol
VBA (Excel) based wrapper for Chrome Developer Protocol (CDP) - sorta a VBA version of Puppeteer/Selenium
Note: if you can use Puppeteer, Playright, Selenium, or some other tool - then use it! But if you can only use VBA, then this is meant to provide a means to automate Chrome or Edge based browsers. (Possibly Firefox via its limited CDP support, though currently untested/nonfunctional).
See [color=var(--color-accent-fg)]https://chromedevtools.github.io/devtools-protocol/ for overview of Chrome Devloper Protocol
Initial work based on information and clsEdge from [color=var(--color-accent-fg)]https://www.codeproject.com/Tips/5307593/Automate-Chrome-Edge-using-VBA
Primarily connects directly to browser using Chrome/Edge's ability to use the CDP via pipes when started, however, now also has basic support for connecting to browser through standard websocket interface so can reuse already open browser if started with CDP port 9222 listening.
Currently primarily tested with and assumes working with Edge; however will detect and support spawning Chrome and possibly FireFox (Chrome should work at least in websocket mode, Firefox is untested)
[color=var(--color-accent-fg)]TODO
  • improve/add usage documentation
  • generator needs some more work (still has some class names too long/clash, still has some clashes with reserved words, incorrectly assumes class for unspecified object)
[color=var(--color-accent-fg)]Note
when downloading the source files from git, be sure to convert to DOS/Windows CRLF style endings for the text files or Office may import as wrong module type (regular modules instead of class modules) - to be updated to ensure git always does this
[color=var(--color-accent-fg)]Usage
您需要登录后才可以回帖 登录 | 免费注册

本版积分规则

手机版|关于我们|联系我们|ExcelHome

GMT+8, 2024-11-17 23:53 , Processed in 0.038871 second(s), 11 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 1999-2023 Wooffice Inc.

沪公网安备 31011702000001号 沪ICP备11019229号-2

本论坛言论纯属发表者个人意见,任何违反国家相关法律的言论,本站将协助国家相关部门追究发言者责任!     本站特聘法律顾问:李志群律师

快速回复 返回顶部 返回列表