首页 > 代码库 > Slenium_java_3 Try demo on 12306.cn
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
Slenium_java_3 Try demo on 12306.cn
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。