Cheng
Cheng

Reputation: 206

How to change the extract path for Internet explorer driver selenium

How to set the extract path using python

"Specifies the full path to the directory used to extract supporting files used by the server. Defaults to the TEMP directory if not specified."

https://github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver shows that there is a Command-Line Switches that allow you to change the settings. I have tried a few ways on python but I still cannot change the extract path.

Upvotes: 0

Views: 724

Answers (1)

Tarun Lalwani
Tarun Lalwani

Reputation: 146510

Seems like this is not available in latest python binding. But you can monkey patch it to support the same

from selenium import webdriver

from selenium.webdriver.ie.service import Service

orig_command_line_args = Service.command_line_args


def patch_command_line_args(self):
    args = orig_command_line_args(self)
    return args + ["--extract-path=/tmp"]

Service.command_line_args = patch_command_line_args

driver = webdriver.Ie()

Upvotes: 1

Related Questions