Python 3 + msedgedriver tests chrome handles with the new version of msedge

Time:2020-9-7

Download the driver first https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/

Then unzip and add the extracted folder to the environment variable path

Then install two packages:

pip install msedge-selenium-tools selenium

Then you can:

from msedge.selenium_tools import Edge, EdgeOptions

options = EdgeOptions()
options.use_chromium = True
options.binary_location = r"C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe"
options.add_argument("headless")      
options.add_argument("disable-gpu")
browser = Edge(options = options)
browser.get('https://www.google.com')
browser.save_screenshot('google.png')
print('done') browser.quit()

 

Recommended Today

Layout of angular material (2): layout container

Layout container Layout and container Using thelayoutDirective to specify the layout direction for its child elements: arrange horizontally(layout=”row”)Or vertically(layout=”column”)。 Note that if thelayoutInstruction has no value, thenrowIs the default layout direction. row: items arranged horizontally.max-height = 100%andmax-widthIs the width of the item in the container. column: items arranged vertically.max-width = 100%andmax-heightIs the height of the […]