相关疑难解决方法(0)

访问Firefox中的文件下载对话框

是否有任何类型的API可以让我在Firefox中操作文件下载对话框?(我想访问用户做某事时出现的那个,而不是自己发起一个).

我想要做的是从Selenium访问这个对话框(以及Selenium"特权模式"是否足以访问chrome接口是我不确定的事情).

firefox selenium dialog

81
推荐指数
5
解决办法
11万
查看次数

selenium 2 web驱动程序另存为对话框

使用selenium 2和webdriver我的一个脚本需要以pdf或csv保存报告,只需调出另存为对话框.我不知道如何与它互动.我现在尝试在Firefox中,但希望它能在所有浏览器中运行.

我读了2009年的一些帖子,webDriver和selenium无法访问另存为对话框但是想知道现在是否有一个解决方法.

我只需要单击保存单选按钮,这样就不会尝试打开它,然后单击保存按钮

selenium

5
推荐指数
1
解决办法
1万
查看次数

如何在'desiredCapabilities'中添加selenium chrome选项?

对于selenium我有一堆chrome选项,我需要通过它传递给远程webdriver DesiredCapabilities.在这个页面上有一个关于如何执行此操作的java示例,但是如何在python中执行此操作?该文档是非常差的.

这是我到目前为止的代码:

prefs = {
    "profile.default_content_settings.popups":0,
    "download.prompt_for_download": "false",
    "download.default_directory": cwd,
}
chrome_options = Options()
chrome_options.add_argument("--disable-extensions")
chrome_options.add_experimental_option("prefs", prefs) 

capabilities = DesiredCapabilities.CHROME

#code I could not find 
#I need something like
#capabilities.add_options(chrome_options)

driver = webdriver.Remote(
            command_executor='http://aaa.bbb.ccc:4444/wd/hub',
            desired_capabilities=capabilities)
Run Code Online (Sandbox Code Playgroud)

有没有想过要这样做?或者在哪里找到合适的文件?

python selenium google-chrome

4
推荐指数
1
解决办法
5855
查看次数

如何从Python Selenium ChromeDriver中保存在Chrome中打开的嵌入式PDF

ChromeDriver for Selenium能够在登录后打开嵌入式PDF,但是如何将chrome文件中的PDF文件保存到本地磁盘?谢谢.

python google-chrome webdriver selenium-webdriver

3
推荐指数
1
解决办法
3769
查看次数

将 Selenium ChromeDriver UserPreferences 设置为另存为 PDF

我正在使用 ChromeDriver 2.33 并使用 kiosk 打印自动单击“打印预览”对话框上的“打印”按钮,但是它将文档发送到打印机而不是 PDF。

我在这个堆栈溢出问题上尝试了解决方案,但无济于事。

这是我正在使用的代码:

ChromeOptions o = new ChromeOptions();
o.AddArgument("--kiosk-printing");
o.AddUserProfilePreference("printing.print_preview_sticky_settings.appState", "{\"version\":2,\"isGcpPromoDismissed\":false,\"selectedDestinationId\":\"Save as PDF\"");
chrome = new ChromeDriver(dir, o);
Run Code Online (Sandbox Code Playgroud)

谁能告诉我如何将打印机从实际打印机设置为 PDF?

selenium selenium-chromedriver selenium-webdriver

3
推荐指数
1
解决办法
7299
查看次数