Slenium_java_3 Try demo on 12306.cn
I find a nice selenium java demo on 12306.cn. Because of the website changed alot,the demo not work for12306.cn. For next several days, I have below works.
- I will make the demo work (2 days)
- I will redesign the demo from css selector to xpath(1day).
Today's work as below. more will come tomorow. :)
import org.openqa.selenium.*;
import org.openqa.selenium.firefox.FirefoxDriver;
public class test12306 {
public static void main(String[] args) throws InterruptedException{
//public static void test()throws InterruptedException{
WebDriver wd = new FirefoxDriver();
wd.get("http://www.12306.cn/");
//WebDriver wd;
//wd= new FirefoxDriver();
// wd.get("www.12306.cn");
Thread.sleep(1000);
wd.findElement(By.cssSelector("img[alt=\"购票\"]")).click();
Thread.sleep(1000);
}
}
here is the original owner-> http://blog.csdn.net/xc5683/article/details/9629827
浙公网安备 33010602011771号