Error when trying to scrape with selenium and firefox using pyCharm
First, I installed selenium. Next, I tried to install firefox, but there was only a module named selenium-firefox, so I installed it.
Next, I downloaded geckodriver from a browser, unzipped it, and moved it to a location in my PATH.
And here's the code I want to execute: path is entered correctly
driver = Firefox (executable_path ='/ mypath/geckodriver') url = "https: // url /" options = FirefoxOptions () options.add_argument ('-headless') browser = Firefox (options = options) browser.get (url) browser.save_screenshot ("website.png") browser.quit ()
When you run this
selenium.common.exceptions.SessionNotCreatedException: Message: Expected browser binary location, but unable to find binary in default location, no moz: firefoxOptions.binary' capability provided, and no binary flag set on the command line
I get an error like this. It seems that firefox doesn't exist, why?
I tried various things, but I couldn't find the cause.
Answer # 1
Looking at the image, it looks like a list of pip libraries, but I thought I would install Firefox with pip.
Firefox isn't written in Python, so it's not something you install with pip.
Install it by normal means.
I don't know what OS you are using, but google with "OS name firefox install".
- python scraping error
- python - selenium: element specification an error occurs in the code that can be executed once
- python - login automation error in selenium [error: device_event_log_implcc (211)]
- python scraping error
- python - about scraping using selenium
- when scraping with python, it says none
- [python] graphviz output format error
- python - in raspberry pi, the error occurs only in the case of the automatic start program using systemd
- python - categorical_crossentoropy error does not resolve
- python - i want to display the scraping result in the browser
- readcsv error in python
- python - i want to display an image with pysimplegui, but an error occurs
- python - i get an error when connecting to a voice channel with discordpy
- python - web scraping what to do when a webdriverexception occurs on starbucks hp
- python - sklearn, svm error
- python 3x - best estimator: i get an error with no syntax, so please tell me what to do
- an error occurs during python scraping (retrieving property information from suumo)
- [python] i don't know how to solve the error
- python - an error has occurred in yolo v3
- python : Incorrect import of variables and functions from other files
- python : Selenium throws an error, but removing options= options it disappears
- python : How to make the code asynchronous?
- python : When using import requests with Selenium immediately after starting the browser and loading the site, the browser close
- python : How to parse a site where there is pagination and when you click on the page, the url in the browser bar does not chang
- python : When searching for a specific element, I get False as an answer, although I should get True Selenium WebDriver
- Finding and summing all values in Python Selenium page
- python : How to launch browser through proxy in firefox selenium
- python : Selenium how to remove this text in the console?
- python : Click on all "show_more_matches" on the page