Slenium_java_3 Try demo on 12306.cn

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.