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
- How to get the current value of Selenium, Python3, combo box
- python : Scraping, part of the text being automatically acquired with English translated into English
- python : How to fix this error "UnboundLocalerror: Local Variable 'name_of_lawyer_answer' referented before assignment"?
- How to get DevTools ->Sources via Selenium in Python?
- python : Why gives the Chrome Failed to Start error?
- python : I can not configure the SELENIUM operation on the Linux server
- python : How to resume code work from the desired string
- python : Selenium Chrome Headless Disable-GPU
- python : Heroku and Selenium.