inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

파이썬 입문 및 웹 크롤링을 활용한 다양한 자동화 어플리케이션 제작하기

웹 브라우저 없는 스크랩핑 및 파싱 실습(1) - 인프런

firefox 에러뜨네요

342

Video

작성한 질문수 3

0

아래와같이 입력했습니다.

import sys

import io

from selenium import webdriver

import time

from selenium.webdriver.firefox.options import Options

sys.stdout = io.TextIOWrapper(sys.stdout.detach(), encoding = 'utf-8')

sys.stderr = io.TextIOWrapper(sys.stderr.detach(), encoding = 'utf-8')

firefox_options = Options()

firefox_options.add_argument("--headless") #CLI

driver = webdriver.Firefox(firefox_options=firefox_options, executable_path='d:/dbms/webdriver/firefox/geckodriver')#phantomjs 실행

driver.set_window_size(1920,1280)#화면사이즈 지정

driver.implicitly_wait(5)#암묵적으로 5초 쉼,빠르면그냥넘어감

driver.get('https://google.com')

time.sleep(5)#5초대기 브라우져없으면 필요없음

driver.save_screenshot("d:/dbms/web_ff.png")

driver.implicitly_wait(5)#암묵적으로 5초 쉼,빠르면그냥넘어감

driver.get('https://www.daum.net')

time.sleep(5)

driver.save_screenshot("d:/dbms/web2_ff.png")

driver.quit()

print('스크린샷 완료')

에러는

Traceback (most recent call last):

File "D:dbms3-6-3.py", line 13, in

driver = webdriver.Firefox(firefox_options=firefox_options, executable_path='d:/dbms/webdriver/firefox/geckodriver')#phantomjs 실행

File "C:Anaconda3envssection3libsite-packagesseleniumwebdriverfirefoxwebdriver.py", line 174, in init

keep_alive=True)

File "C:Anaconda3envssection3libsite-packagesseleniumwebdriverremotewebdriver.py", line 157, in init

self.start_session(capabilities, browser_profile)

File "C:Anaconda3envssection3libsite-packagesseleniumwebdriverremotewebdriver.py", line 252, in start_session

response = self.execute(Command.NEW_SESSION, parameters)

File "C:Anaconda3envssection3libsite-packagesseleniumwebdriverremotewebdriver.py", line 321, in execute

self.error_handler.check_response(response)

File "C:Anaconda3envssection3libsite-packagesseleniumwebdriverremoteerrorhandler.py", line 242, in check_response

raise exception_class(message, screen, stacktrace)

selenium.common.exceptions.WebDriverException: Message: newSession

[Finished in 4.922s]

이렇게 났습니다. 어디가 잘못 된 것인지 잘 모르겠네요 의견 부탁드립니다.

웹-크롤링 python

답변 1

0

좋은사람

에러 내용을 잘 확인하시면 될 것 같습니다.
몇 번 언급드리지만, 답변이 많이 늦을 가능성이 있으니 쪽지로 보내주세요.
에러 내용 : selenium.common.exceptions.WebDriverException: Message: newSession
현재 firefox 드라이버 버전 업그레이드와 관련된 이슈로 검색 되네요.
https://github.com/SeleniumHQ/selenium/issues/6590
https://github.com/mozilla/geckodriver/issues/1406
같은 오류에 대해서 타 개발자분들도
버전 업그레이드를 통해서 해결 사례가 나오고 있습니다.

현재 예제에서 error 발생

0

367

3

유튜브 동영상 다운로드

0

1448

2

Atom 에디터 관련

0

337

1

위시켓 폼데이터

0

274

1

스케줄러 사용 관련 질문 드립니다

0

627

1

selenium 에러

0

428

1

Progress bar 쓰레드 관련

0

489

1

Install Package 관련 문의

0

328

1

tkinter 샘플 코드 실행 오류 건

0

1267

1

4-7-6 네이버 & 카카오 주식 정보 가져오기

0

381

1

네이버자동로그인_by_selenium

0

876

1

위시캣 로그인 처리 및 크롤링 질문

0

345

1

2-8-1 네이버이미지 크롤링 질문

1

604

3

li:nth-of-type 질문

0

350

2

에러가 뜨는데 잘 모르겠어요ㅠ

0

401

2

Install Packages 항목이 안보이는 이유가 뭘까요?

0

401

2

환경변수 Path 설정 방법

0

631

1

웹 브라우저 없는 스크랩핑 및 파싱 실습(1) - 인프런

0

333

1

웹 브라우저 없는 스크랩핑 및 파싱 실습(1) -git주소

0

477

3

download2-8-1. py질문

0

203

1

ip 차단 당하는 거 같은데 아무리 랜덤주고, sleep 줘도 안 되는데 다른 방법 더 있을까요??

0

645

1

인프런 환경이 바뀌어서 제나름대로 하는데

0

196

1

다시올려주신 예제파일로하는데

0

190

1

아직도 에러가뜨나보네요?

0

584

1