I'm running a lottery syndicate and want to automate our system to check for the lottery numbers (UK National Lottery)
The url I am getting is: https://www.national-lottery.co.uk/player/p/results/lotto.ftl
and I am using
<?php
$html = file_get_contents("https://www.national-lottery.co.uk/player/p/results/lotto.ftl");
?>
I would like to be able to grab this area of the page, namely the numbers:
The problem is, there is a lot of content on that page and I don't know the first step I would take to break it all down.
Does anyone know a way to do this in PHP or jQuery?
Thanks
what about an existing rss feed http://www.alllotto.co.uk/rss/latest.rss
I would take a look at the PHP Simple HTML DOM Parser. It simplifies scraping and does what you're asking.
Using this, finding LI elements is as easy as this:
foreach($html->find('li') as $element) {
echo $element . '<br>';
}