//导入Selenium 库和FirefoxDriver 库

package com.learningselenium.simplewebdriver;

import org.openqa.selenium.*;

import org.openqa.selenium.firefox.FirefoxDriver;

public class testFirefoxDriver(){

  public static main(String[] args){

    WebDriver driver = new FirefoxDriver(); //启用FirefoxDriver

    driver.get("http://www.baidu.com"); //讲在Firefox 浏览器中打开百度主页

    //讲获取当前页面的URL地址并存储在变量url 中。如果相同的操作需要在Selenium IDE 中完成,那么需要通过storeLocation 命令来完成

    String url = driver.getCurrentUrl();

    System.out.println(url);

    driver.close();

  }

}

[Selenium] 使用Firefox Driver 示例的更多相关文章

  1. Selenium启动Firefox示例(java版)

    本文示例使用selenium启动Firefox,并将浏览器窗口最大化,在百度搜索框内输入"HelloWorld",最后点击搜索按钮. 源代码如下: 1 package com.se ...

  2. Selenium启动Firefox示例(python版)

    目前做selenium自动化使用的主流语言分为java和python,前一篇为java版,本篇介绍python实现selenium启动Firefox. 1 #-*- coding:utf-8 -*- ...

  3. Selenium常用API用法示例集----下拉框、文本域及富文本框、弹窗、JS、frame、文件上传和下载

    元素识别方法.一组元素定位.鼠标操作.多窗口处理.下拉框.文本域及富文本框.弹窗.JS.frame.文件上传和下载 元素识别方法: driver.find_element_by_id() driver ...

  4. Selenium+Headless Firefox

    背景 今天本地调试基于Selenium+PhantomJS的动态爬虫程序顺利结束后,着手部署到服务器上,刚买的热乎的京东云,噼里啪啦一顿安装环境,最后跑的时候报了这么个错误: UserWarning: ...

  5. selenium和Firefox版本不兼容

    selenium8.py coding = utf-8 from selenium import webdriver driver = webdriver.Firefox() driver.get(' ...

  6. 解决selenium驱动Firefox跳转页慢慢慢的问题

    首先我给自己定义为是一个更新偏执狂.不知道从哪个版本开始,使用selenium驱动打开Firefox浏览器时,会跳转到官网指定页,这个过程真是慢得要死. 为了解决这个问题,我是查了很多资料,解决方案是 ...

  7. python中使用selenium调用Firefox缺少geckodriver解决方法

    from selenium import webdriver driver=webdriver.Firefox() 会报错 解决方法: 因为缺少geckodriver.exe,先到https://gi ...

  8. windows下安装配置python + selenium 来驱动firefox

    第一步,首先下载安装python ,我下载的是3.5版本,这个版本,自带了pip工具,不需要安装pip了 :) 链接地址:python 3.5 第二步,执行pip install selenium 安 ...

  9. python中用selenium调Firefox报错问题

    python在用selenium调Firefox时报错: Traceback (most recent call last):  File "G:\python_work\chapter11 ...

随机推荐

  1. Execption异常 手动和自动抛除异常

    package cn.zmh.Exception; /* * * try{ * 需要被检测的语句 * } * catch(异常类 变量){ * 异常的处理语句 * } * finally{ * 一定会 ...

  2. 框架-数据库定义MD5加密

    1.--定义Md5加密declare @pt_pwd varchar(50)set @pt_pwd = ''set @pt_pwd = substring(sys.fn_sqlvarbasetostr ...

  3. react+flask+antd

    待学习: 1.https://www.cnblogs.com/jlj9520/p/6625535.html 2.http://python.jobbole.com/87112/ 3.

  4. Answer's Question about pointer

    When you create a new pointer, this will be in heap until you delete it.  So what you said is sort o ...

  5. python 工具 FFT变换

    import numpy as npimport pylabwave_data =np.fromfile("C:\\Users\\Administrator\\Desktop\\bins\\ ...

  6. Swift的可选链,类型转换和扩展

    可选链(Optional Chaining) 可选链是一种请求或调用属性.方法,子脚本的过程. 可选性体现于请求或调用的目标当前可能为nil.若不为nil则成功调用.否则返回nil并将链失效. 调用可 ...

  7. 微信小程序 项目实战(一)生命周期 配置服务器信息 splash启动页

    步骤一:小程序 生命周期 //app.js App({ onLaunch: function () { //当小程序初始化完成时,会触发onLaunch(全局只触发一次) }, onShow: fun ...

  8. Hadoop+HBase+ZooKeeper分布式集群环境搭建

    一.环境说明 集群环境至少需要3个节点(也就是3台服务器设备):1个Master,2个Slave,节点之间局域网连接,可以相互ping通,下面举例说明,配置节点IP分配如下: Hostname IP ...

  9. CF 535c Tavas and Karafs

    Tavas and Karafs Time Limit:2000MS     Memory Limit:262144KB     64bit IO Format:%I64d & %I64u S ...

  10. mtk机型的一次救砖经历

    在recovery里清除了data,cache,system三个分区,没有刷机,重启到bootloader,准备另刷recovery. 有急事走开了,回来时发现手机黑屏,无论什么组合键都没反应,以为是 ...