파이썬에서 selenium을 이용하여 크롬 브라우저 띄우기
2018. 8. 7. 18:29
반응형
사전 작업이 필요(환경변수에 파이썬도 추가되어있는 상태)
selenium 설치
cmd 창에서 pip install selenium 으로 설치한다.
크롬드라이버 내려받기
https://sites.google.com/a/chromium.org/chromedriver/downloads
경로는 편한 곳으로 내려받기
절대 파일명은 selenium.py 로 하지 말것! 모듈명이 selenium이라 이름이 같으면 실행이 안된다고 한다
멋 모르고 파일명을 selenium으로 해놨다가 삽질함
from selenium import webdriver driver = webdriver.Chrome('C://chromedriver.exe') driver.implicitly_wait(3) driver.get('http://www.naver.com')
위 코드를 작성하고 파이썬 실행
반응형
'지식메모 > Python' 카테고리의 다른 글
파이썬과 자바 selenium 사용법 간단한 기능 비교 및 xpath 사용법 (0) | 2018.08.08 |
---|---|
파이썬 TabError: inconsistent use of tabs and spaces in indentation 에러 해결 (Atom 에디터 옵션 설정) (0) | 2018.08.08 |
android calabash apk is not signed with any of the available keystores 문제 해결을 위한 apk resign 하기 (0) | 2015.05.29 |
이클립스에서 Ruby 플러그인 추가하기 (2) | 2015.05.19 |
윈도우 7 Ruby 설치하기 & Android calabash 설치 후 apk 실행하기 (0) | 2015.05.15 |