Receiving Site Information

1

Hello, everyone!

I have a problem and I do not know what to do next. The situation is this: My program accesses a ticket sales website ... It needs to get the first ticket amount, but I have no idea how to do it.

Here's a sample link: link

If anyone can give me strength I will be very grateful!

    
asked by anonymous 22.06.2015 / 05:09

1 answer

1

The first thing you need to do is download the page. This is not difficult, so I will focus my answer on the second part.

You need to get this element you want through the DOM parser of the language library you are using. For this, you will have to identify it.

Using the "Inspect Element" of Firefox (right click on the page -> Inspect Element -> click the square with an arrow that appears in the upper left corner of the panel that appears and hover over the element you want), I was able to identify that the element you want is of the "amount-price-amount" class. Through document.getElementsByClassName("amount price-amount") , I got 32 elements as an answer. Soon, I saw that I would have to refine the search.

I used the same tool to search for the yellow rectangle class (s) and saw that it is "cluster cluster-ONEWAY default". Since we want the first one, we're behind the document.getElementsByClassName("cluster cluster-ONEWAY default")[0] element. Just add the two expressions: document.getElementsByClassName("cluster cluster-ONEWAY default")[0].getElementsByClassName("amount price-amount") . This returns only two% of% s. The first is the price in real and the second is the dollar price, which is what you are looking for.

Note that even after the page is loaded, this data has not yet appeared. Therefore, you will have to execute these commands only after loading the part of the page you want. Find out what events the page launches after loading these parts and run the commands in those events.

    
22.06.2015 / 10:44