主要是想获取弹窗里的内容和关闭弹窗
附件搞上来了
Examples.zip
(1.5 MB, 下载次数: 8)
下面是描述(搬自PerditionC)
VBAChromeDevProtocolVBA (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)]Notewhen 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
|