firefox浏览器不需要下载驱动,原生支持,以下是代码运行环境,firefox启动封装在方法startFirefox()中 import org.openqa.selenium.WebDriver; import org.openqa.selenium.firefox.FirefoxDriver; public class browser<Webdirver> { public static void main(String[] args) { WebDriver driver = star
class selenium.webdriver.firefox.webdriver.WebDriver(firefox_profile=None, firefox_binary=None, timeout=30, capabilities=None, proxy=None) Bases: selenium.webdriver.remote.webdriver.WebDriver quit() Quits the driver and close every associated window.
1. 首先本机Firefox浏览器需要安装一下firebug插件,具体怎么安装这里不赘述,网上教程很多. 2. 具体自动化实现的代码如下: #encoding=utf-8 from selenium import webdriver import unittest, time from selenium.webdriver.common.keys import Keys class TestDemo(unittest.TestCase): def test_openFireBug(self):