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 had below works.
- I'll make the demo work (2 days)
- I'll redesign the demo from CSS selector to XPath (1day).
Today ' s work as below. More would 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 W D = 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=\" Ticket)). Click (); Thread.Sleep (1000); }}
Here is the original owner--http://blog.csdn.net/xc5683/article/details/9629827
Slenium_java_3 Try demo on 12306.cn