본문 바로가기
파이썬

python selenium synchronous xmlhttprequest on the main thread is deprecated 해결 방법

by 행복론자 2021. 8. 19.

파이썬에서 selenium 패키지, chromedriver.exe를 이용하여 웹페이지 스크래핑 중 다음과 같은 로그가 나오는 경우가 있습니다.

selenium synchronous xmlhttprequest on the main thread is deprecated

 

 

에러는 아니기에 동작에는 큰 문제가 없지만 찾아보니 딱히 해결책이 없는 것 같습니다.

 

webdriver를 사용할 때 다음과 같은 옵션을 넣어 deprecated 문구가 보이지 않도록 처리했습니다.

options = Options()
options.add_argument('--headless')
options.add_argument('--hide-scrollbars')
options.add_argument('--disable-gpu')
options.add_argument("--log-level=3")  # fatal
driver = webdriver.Chrome(chrome_options=options)

 

반응형

'파이썬' 카테고리의 다른 글

python-dotenv 사용법 python .env 파일 저장/수정하는 법  (0) 2022.08.06
이 포스팅은 쿠팡파트너스 활동의 일환으로, 이에 따른 일정액의 수수료를 제공받습니다.

댓글