我正在使用
VBA
自动执行Chrome
,通过File 的
类型button
将文件上传到网站我不知道如何在 Chrome 中上传脚本
我当前的 VBA:
Sub UploadFile()
Dim bot As WebDriver
Set bot = New WebDriver
bot.Start "chrome"
bot.Get "https://tutorialehtml.com/en/html-tutorial-upload-form/"
'#continue script here please"
End Sub
最佳答案
如果有任何带有属性type = 'file'
的输入字段,您可以使用以下代码:
bot.FindElementByCss("input[type='file']").SendKeys "path of file"
关于excel - VBA Selenium with Chrome - 将文件上传到网页,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67659124/