VBA Selenium with Chrome-将文件上载到网页


  1. 我正在使用VBA自动Chrome将文件上传到站点,File类型的button

  2. 我不知道在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"

最新更新