Function 크롬드라이버시작()
Dim Keys As New Keys
Set Sel = New Selenium.ChromeDriver
If Worksheets("강사정보").Range("B5") = "False" Then
'브라우저 안띄우기
Sel.SetCapability "goog:chromeOptions", "{'args':['headless'],'excludeSwitches':['enable-automation']}"
Else
'disable save password popup
'Sel.SetCapability "goog:chromeOptions", "{'args':['--incognito'],'excludeSwitches':['enable-automation']}"
Sel.SetCapability "goog:chromeOptions", "{'excludeSwitches':['enable-automation']}"
End If
Sel.Start
Sel.Window.SetSize 1300, 900
End Function
Function 엣지드라이버시작()
On Error GoTo edgerror
Dim edgever() As String
Set Sel = New Selenium.EdgeDriver
If Worksheets("강사정보").Range("B5") = "False" Then
Sel.SetCapability "ms:edgeOptions", _
"{" & _
"""args"":[""headless""]" & _
"}"
End If
Sel.Start
Sel.Window.SetSize 1300, 900
Exit Function
edgerror:
If (Err.Number = 33) Then
edgever = Split(Err.Description, "n is ")
edgever = Split(edgever(1))
MsgBox "현재 브라우저 버전 " & edgever(0) & "에 맞는 엣지드라이버를 SeleniumBasic 폴더에 다운받아 넣으시오!"
Call 크롬드라이버시작
Sel.Get "https://developer.microsoft.com/ko-kr/microsoft-edge/tools/webdriver/"
While Sel.ExecuteScript("return document.readyState") <> "complete"
Wend
Else
MsgBox "Error " & Err.Number & " " & Err.Description
End If
End Function