I'm looking for a way to get best flying ticket price from website just by parsing it in Java, at start from this particular site :
for example I'm looking for a flight Gdańsk > Barcelona
with some random data:
http://www.kayak.com/flights/GDN-BCN/2015-04-20/2015-04-27
things I've done:
- Found div's I'd like to get from parsing at browser in programmers mode:
div class="sliderFilterLabel">
span id="low_price"> class="min">73 €
on this spot there should be always lowest price.
- tried to parse it using Jsoup and I've found out that code misses most valuable for me divs.
How could I find it or is there any more efficient way to get just one number from whole website.
My code:
Document doc;
try {
// need http protocol
doc = Jsoup.connect("https://www.kayak.pl/flights/GDN,nearby-IBZ,nearby/2015-04-20/2015-04-27").userAgent("Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36").get();
System.out.println(doc);
there is almost no code. After a few tries with jsoup I printed out whole website that I parse and I cannot find divs I need.