我试图设置一个铬的配置文件,但它不起作用。
Chrome版本:版本80.0.3987.106
WebDriver: ChromeDriver 80.3987.106
Selenium Basic: SeleniumBasic-2.0.9.0.exe
Option Explicit
Public Sub openGChrome()
Dim obj As New WebDriver
Dim i As Integer
Const URL = "https://www.linkedin.com/feed/"
Const JS_PROFILE As String = "C:\Users\ChuckNorris\AppData\Local\Google\Chrome\User Data\Default"
Set obj = New ChromeDriver
With obj
.SetProfile JS_PROFILE, True
.Get URL
Stop
.Quit
End With
End Sub
我做错什么了?有什么帮助吗?
编辑:浏览器打开,但我没有任何个人资料选择,我不能登录到没有登录的网站
发布于 2020-03-01 17:28:45
您没有指定什么“不工作”,但我认为您应该从配置文件路径中删除\Default,因为当您不指定配置文件的名称时,意味着您要使用默认配置文件,然后就会隐式地添加\Default。
若要指定默认配置文件以外的特定配置文件,请使用:
.AddArgument ("profile-directory=foldername") 'foldername is the name of the folder with the profile you want to use
https://stackoverflow.com/questions/60476778
复制相似问题