Drive WebDriver with python. Do as much as you can start Edge.
Work in an environment where the python installation is complete.
When I checked the version, it was the following version.
Python 3.8.0
Execute the following command. If necessary, run it on the command line with administrator privileges.
pip install selenium
Check the operation to see if selenium could be imported.
Create a script.
webdriver_sample.py
from selenium import webdriver
#Get Edge Driver
driver = webdriver.Edge()
#Transition to the specified URL
driver.get("https://www.google.co.jp")
Let's run the script.
python .\webdriver_sample.py
Since it is before the environment is built, an error will occur.
selenium.common.exceptions.WebDriverException: Message: 'MicrosoftWebDriver.exe' executable needs to be in PATH. Please download from http://go.microsoft.com/fwlink/?LinkId=619687
I heard that the path to WebDriver does not pass, but I have not installed it yet, so it is as expected.
Install Edge Driver.
Check in Settings → General.
My Edge was the following version.
Microsoft EdgeHTML 18.18362
Check the setting method at the following URL. http://go.microsoft.com/fwlink/?LinkId=619687
Since 18 it is built into Windows 10 and seems to be automatically updated. It seems that you can use it by enabling [Developer Mode].
Change the settings with administrator privileges.
Settings → Updates and Security → For Developers
Sets the radio button for developer mode.
Confirm that WebDriver has been set.
Let's run the script.
python .\webdriver_sample.py
This time I started the browser.
Once you have installed WebDriver, you can restore it from [Developer Mode] without any problem.
Recommended Posts