Python Selenium

1.下载Python2,安装,设置系统变量

2.下载selenium:pip install -U selenium


3.一般firefox安装在非默认位置:

binary = FirefoxBinary('D:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe')    or

binary = FirefoxBinary('D:/Program Files (x86)/Mozilla Firefox/firefox.exe')


driver=webdriver.Firefox(firefox_binary=binary)

如果Java代码实现的话:

        System.setProperty("webdriver.firefox.bin", "D:/Program Files (x86)/Mozilla Firefox/firefox.exe");
        WebDriver driver = new FirefoxDriver();







posted @ 2016-06-02 14:32  午夜飘雪789  阅读(166)  评论(0编辑  收藏  举报