繁体   English   中英

如何更改Internet Explorer驱动程序Selenium的提取路径

[英]How to change the extract path for Internet explorer driver selenium

如何使用python设置提取路径

“指定用于提取服务器使用的支持文件的目录的完整路径。如果未指定,则默认为TEMP目录。”

https://github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver显示有一个命令行开关,可让您更改设置。 我在python上尝试了几种方法,但仍然无法更改提取路径。

似乎在最新的python绑定中不可用。 但是您可以猴子打补丁以支持相同的功能

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()

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM