I am looking to get data from this webpage: http://www.sportinglife.com/greyhounds/racecards/29-10-2014/belle-vue
I have been using jSoup and Java, but can't seem to get the data I am looking for. I need the times of each race (Jump to: 14:18 14:37 14:57 15:17 15:38 15:58 16:18 16:37 16:57 17:17 17:33 17:47 18:04 18:18) and the link that each of them refers to.
I then need to go to each link and print out the 6 dogs in each race.
So the output would look like:
14:18
1 Golden Light
2 Always Late
3 Redley Rooster
4 Redstone Bo Dhu
5 Ballymac Oprah
6 Ballyhill Slide
For each race.
My current code is below, and uses jSoup to extract the runners from the race - but I can't seem to do the first step of getting the race "times" and links to each race page so I can loop through the links and output the runners for each race.
Document doc = Jsoup.connect(
"http://www.sportinglife.com/greyhounds/racecards/29-10-2014/belle-vue/card/834800").get();
Element tableHeader = doc.select("tbody").first();
Map<String, String> data = new HashMap<>();
for (Element element : tableHeader.children()) {
// Here you can do something with each element
String dog = element.select("td:eq(0)").text();
String race = element.select("td:eq(2)").text();
data.put(dog, race);
System.out.println(dog + " " + race);
}
Any help is very much appreciated.... thanks! Rob