ChromeDriver - WebDriver for Chrome 사용법
https://chromedriver.chromium.org/getting-started


* 웹드라이버 다운로드
https://chromedriver.chromium.org/downloads


* 기본 사용법 (파이썬)
import time
from selenium import webdriver

driver = webdriver.Chrome('d:\chromedriver.exe')   #파일 경로
driver.get('https://www.google.com/');
time.sleep(3) 
search_box = driver.find_element_by_name('q')
search_box.send_keys('ChromeDriver')
search_box.submit()


//-------------------
* 서비스 이용
chromedriver.exe 파일 실행
포드 번호 기억

import time
from selenium import webdriver
from selenium.webdriver.chrome.service import Service

serviceurl = 'http://localhost:9515' #서비스 포트 
driver = webdriver.Remote(serviceurl)
driver.get('https://www.google.com/');  # 주소로 이동

 

 

Posted by 코덴스

댓글을 달아 주세요