자유게시판

우분투에 파이썬 파이참 셀리니움 깔고 구글 접속 test검색하는 것을 구현해봄 Simulation typing "test" in the google searching engine, at the situation Hyper-V Ubuntu system

작성자 정보

  • 최고관리자 작성
  • 작성일

컨텐츠 정보

본문

167bde04f7781412a7130e39d1d0795a757e10c2cbk1.png

 

출처 Selenium: Python으로 시작하기 (tistory.com)

를 이용해서

 

 

구글에 접속해서  test를 검색하는 것을

파이썬 + 셀레니움으로 구현해보았다.

 

본좌는 우분투에 파이어폭스를 hyper V를 이용해서 하고 있어서

조금 코드를 수정해야했다.

 

원본에 커먼트처럼 수정을 가했다.

from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys     
from selenium.webdriver.chrome.service import Service      #chrome을 firefox로 변경
from webdriver_manager.chrome import ChromeDriverManager #chrome앞에거는 firefox로 뒤에 드라이브매니져는 GeckoDriver Manager로 변경


class DefaultTest:
   def __init__(self):
       self.driver = webdriver.Chrome()   #webdriver.Firefox로 변경
       # webdriver_manager를 활용하는 경우.
 # self.driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()), options=options)

 

 

 

관련자료

댓글 0
등록된 댓글이 없습니다.

인기검색어


최근글


새댓글