selenium webdriver打开带插件Firefox浏览器

2025-06-12 13:43:54

1、1. 首先,下载和安装python、火狐浏览器,

selenium webdriver打开带插件Firefox浏览器

2、2. 岳蘖氽颐按下win键后,搜索栏中输入: %APPDATA%\Mozilla\Firefox\Profiles\ (回车直接打开插件的路径)

selenium webdriver打开带插件Firefox浏览器

3、3. 步骤2后找到的路径如图所示,其中lhhfzmgb.default 文件夹根据个人用户会不同

selenium webdriver打开带插件Firefox浏览器

4、4. 打开自己的IDE,输入代码如下所示 profileDir = r"C:\Users\admin\AppData\Roaming\Mozilla\Firefox\Pro熠硒勘唏files\hnvpxyyx.default"profile = webdriver.FirefoxProfile(profileDir)driver = webdriver.Firefox(profile)

selenium webdriver打开带插件Firefox浏览器

5、5. 打开火狐浏览器,点击右上角的设置按钮,弹出的菜单中点击【附加组件】安装插件

selenium webdriver打开带插件Firefox浏览器

6、6. 跳转的页面中点击【扩展】,在【寻找更多的扩展】输入框中输入自己想要的差价名称,再点击搜索按钮进行检索

selenium webdriver打开带插件Firefox浏览器

7、7. 检索结果跳转的页面中找到自己的插件后,点击进入详细页面

selenium webdriver打开带插件Firefox浏览器

8、8. 详细页面下,点击如图所示的【添加至...】,默认会开始安装插件

selenium webdriver打开带插件Firefox浏览器

9、9. 回到代码编辑器中,修改代码如下,再运行程序即可from selenium import webdriverprofileDir = r"C:\Users\admin\App肛舀辨乔Data\Roaming\Mozilla\Firefox\Profiles\hnvpxyyx.default"profile = webdriver.FirefoxProfile(profileDir)driver = webdriver.Firefox(profile)driver.get('http://baidu.com')driver.quit()

selenium webdriver打开带插件Firefox浏览器

10、10.如果您觉得有用,记得在下方点击投票、点赞、关注、留言,小编会定期奉上更多的惊喜哦,您的支持才是小编继续努力的动力,么么哒。

selenium webdriver打开带插件Firefox浏览器
声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
猜你喜欢