前言
对于自己近期学习的归纳与应用,只是个简单的线性脚本。
之前学习了selenium,发现csdn上大都是python+selenium,故参考后改成java+selenium,另外把读取本地时间改成了读取网站时间,更为精确。
准备
JAVA环境,Selenium-2.46.0 jar包,火狐浏览器固定版本(自用的可能是32.0)
jar包与火狐浏览器安装包 链接 ,提取码: ybsf
代码
package com.Test;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebDriver.Navigation;
import org.openqa.selenium.WebDriver.Window;
import org.openqa.selenium.firefox.FirefoxDriver;
public class Runner {
public static void main(String[] args) {
String taoBao = "https://www.taobao.com";
WebDriver webDriver = new