In this post, we are going to learn how to solve Python Webdrivermanager.install does not work for edge. Sometimes when we try to launch Microsoft Edge by using webdriver manager, this error is raised “type error level not an integer or a valid string none edge”. It is because a Problem with the logger of Webdrivermanager.
1. Python Webdrivermanager.install does not work for edge
To laucnh edge webdriver, we have to downloaded the edge browser driver zip and unzipped and copied it to the Python script directory. But it is time-consuming, We can automate this work just simply using The webdriver-manager . The first step is to Install the web driver manager by using the command. Let’s understand how to use it in our code to launch Microsoft Edge browser
pip install webdriver-manager
Python selenium Program to launch MS Edge browser
To solve this problem first, we have to import required API like logging API into our program. Then We have to make a change in the log level by using code “edgeChromiumDriverManager(log_level=logging.ERROR).install()” . Let us understand more with the below example.
- How to Install selenium on windows Python
- How to install selenium in VSCode
- How to open chrome browser in selenium Python
- How to open Edge browser in selenium Python
- How to open Firefox browser in selenium Python
- Executable path has been deprecated in selenium
- Solved version of ChromeDriver only supports Chrome version 98
- How to make test suite in selenium Python
- Solved selenium find_element_by_* commands are deprecated
from selenium import webdriver
import logging
from webdriver_manager.microsoft import EdgeChromiumDriverManager
driver = webdriver.Edge(EdgeChromiumDriverManager(log_level=logging.ERROR).install())
driver.maximize_window()
driver.get("https://google.com")
print('driver Title:',driver.title)
print('Driver name:',driver.name)
print('Driver URL:',driver.current_url)
driver.quit()
Output
driver Title: Google
Driver name: msedge
Driver URL: https://www.google.com/