728x90

Selenium 3

ChromeDriver를 자동으로 업데이트 하기

SeleniumBasic을 사용하여 Chrome제어를 할 때가 많은데,Chrome이 버전업이 되면 ChromeDriver도 다시 새 버전을 설치해 줘야 합니다.이게 귀찮아 지게 되면,,,, 우선 현재 Selenium이 설치된 폴더를 확인해 봅니다.마땅한 Registry를 찾지 못해서 대충 CLSID에 있는 걸 써 봅니다.Private Function getSeleniumPath() Dim sPath As String sPath = CreateObject("WScript.Shell").RegRead("HKEY_CLASSES_ROOT\CLSID\{0277FC34-FD1B-4616-BB19-5D556733E8C9}\InprocServer32\CodeBase") getSeleniumPath = ..

Excel - VBA 2024.04.26

[VBA] Compound class names not permitted

SeleniumBasic을 이용하여 Web을 스크랩할 때 Tag의 class가 아래처럼 기술된 경우 FindElementByClass 방법으로 이 버튼을 클릭하고자 할 때 발생하는 오류와 해결하는 방법입니다. 현위치 1. FindElementByClass를 사용하는 경우 오류 발생 wd.FindElementByClass("btn btnCurrent geoLocation Btn").Click => Compound class names not permitted 오류가 발생 2. FindElementByCss와 Title을 사용하는 방법 wd.FindElementByCss("button[title='현재위치를 표시합니다.']").Click 3. FindElementByCss와 class를 사용하는 방법 wd...

Excel - VBA 2023.09.09

Selenium Basic 사용중 Unexpected Alert Open Error

셀레니움을 이용하여 Chrome으로 Web 문서를 조회할 때 갑자기 아래처럼 오류가 발생하며 더이상 진행을 할 수 없을 때 처리가 필요합니다. 에러코드 26에 UnexpectedAlertOpenError인데, 실제 웹페이지에서는 메시지 팝업이 되는 것입니다. 아래와 같이 Error 처리하고 다음 단계로 넘어갑니다. On Error GoTo ERR_HD For r = LBound(vD, 1) To UBound(vD, 1) '// User code area NEXT_ROW: Next r WD.Close SEt WD = Nothing Exit Sub ERR_HD: If InStr(1, Err.Description, "Alert") 0 Then WD.SwitchToAlert.accept '// or WD.Swi..

Excel - VBA 2023.03.28
728x90