일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
- Word Cloud
- terraform
- 프로그래머스 월간 코드 챌린지
- PostgreSQL 설치 시 에러
- 바이오데이터 엔지니어
- 프로그래머스 코딩테스트 연습
- 애드센스
- 디자인 패턴
- git
- 프로그래머스 코딩 테스트 연습
- 브랜디
- selenium
- c#
- heroku
- pycharm
- Python
- 프로그래머스 월간 코드 챌린지 시즌1
- 프로그래머스 코딩테스트 연습문제
- PostgreSQL
- github actions
- github
- 클린 코드
- 스프링 부트와 AWS로 혼자 구현하는 웹 서비스
- WPF
- Spring Boot
- 파이썬
- FastAPI
- Codeforces
- Firefox
- 스코페2021
- Today
- Total
프로그래밍 연습하기
Python Selenium Firefox 사용 시 Message: binary is not a Firefox executable 에러 본문
Python Selenium Firefox 사용 시 Message: binary is not a Firefox executable 에러
john.k 2023. 8. 19. 14:09WSL로 파이썬 셀레니움을 사용하려던 중 다음과 같은 에러를 봤습니다.
selenium.common.exceptions.InvalidArgumentException: Message: binary is not a Firefox executable
분명히 정확한 위치의 파이어폭스 바이너리 경로를 넣어줬는데 에러가 나서 감을 못 잡고 있었는데,
한참 찾다 다음과 같은 방법으로 해결할 수 있었습니다.
options = Options()
options.add_argument('--no-sandbox')
options.add_argument('--disable-dev-shm-usage')
geckodriver_path = "/snap/bin/geckodriver" # specify the path to your geckodriver
driver_service = Service(executable_path=geckodriver_path)
self.driver = webdriver.Firefox(options=options, service=driver_service)
위와 같이 옵션에 argument를 추가해주니 정상적으로 작동했습니다.
다음 답변을 참고했습니다.
Selenium/Ubuntu22 bug "Message: binary is not a Firefox executable"
Curious, does anyone here know how I might fix this Selenium/Ubuntu22 bug? Got a Python3 script that still runs fine on Debian 12, but I'm trying to use it on Ubuntu22 with firefox and geckodriver ...
stackoverflow.com
원래는 그냥 Chrome을 사용하려고 했었는데, 제가 시도하려는 환경은 ARM64 Ubuntu인데 크롬은 ARM64 Linux용 빌드가 없는 것 같더라구요. 그래서 Firefox를 사용하려다 보니 이런 에러를 만나게 되었습니다.
Ubuntu에서 Firefox을 사용해보려는 중에도 꽤 많이 헤멨는데 이것저것 닥치는대로 해보다보니 정리가 안되서 과정 공유는 좀 힘들 것 같네요.
'Python' 카테고리의 다른 글
Youtube 재생목록(Playlist)안의 동영상 ID 얻기 (0) | 2023.09.12 |
---|---|
Alembic alembic.ini 파일 sqlalchemy.url 동적으로 수정하기 (0) | 2023.08.11 |
Gunicorn access_log_format이 적용되지 않는 문제 (0) | 2023.08.08 |
Pycharm Unexpected Argument 경고 (1) | 2021.07.31 |
Venv가 활성화 되어도 경로 인식을 못할 때 (0) | 2021.06.08 |