不确定如何执行脚本,但是在实例化
webdriver对象时,可以指定a
FirefoxProfile作为
firefox_profile参数。这是通过创建一个
FirefoxProfile对象(下面的示例)并提供目标配置文件的路径作为参数来完成的:
from selenium import webdriver# ...profile = webdriver.firefox.firefox_profile.FirefoxProfile('/path/to/your/profile')driver = webdriver.Firefox(firefox_profile=profile)
据我所知,您无法
driver在实例化实例后修改配置文件(尽管我可能是错的-
如果您需要这样做,值得尝试:))。在这种情况下,您将在每个脚本中创建一个配置文件,该配置文件指向要使用的配置文件,然后使用指向由创建的对象
driver的
firefox_profile参数实例化。
profile``FirefoxProfile
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)