Firefox cons中的Selenium Python执行脚本

2024-04-29 12:47:26 发布

您现在位置:Python中文网/ 问答频道 /正文

我可以在googlechrome控制台中运行以下脚本。如何在Firefox中使用Selenium Python实现这一点?在

date1 = "13-11-2015T17:25"
date2 = "25-11-2015T11:01"
window.PF.start_diff(date1, date2)

我试过使用driver.executeScript(),但我不认为我能用它来实现。 这就是我在Firefox和Google Chrome控制台中所尝试的。首先,我登录到应用程序并执行脚本,这是我得到的:

enter image description here

所以它似乎在起作用。请注意,执行命令后会出现弹出窗口。在

我尝试使用以下两种方法:

^{pr2}$

也尝试过这个:driver.execute_async_script


Tags: 脚本应用程序driverseleniumgooglediffchromefirefox