You marked it as PHP, so here is a PHP solution :)
$dom = new DOMDocument; $dom->loadHTMLFile('http://www.morewords.com/ends-with/aw'); $anchors = $dom->getElementsByTagName('a'); $words = array(); foreach($anchors as $anchor) { if ($anchor->hasAttribute('href') AND preg_match('~/word/\w+/~', $anchor->getAttribute('href'))) { $words[] = $anchor->nodeValue; } }
CodePad
If allow_url_fopen disabled in php.ini , you can use cURL to get HTML.
$curl = curl_init(); curl_setopt($curl, CURLOPT_URL, 'http://www.morewords.com/ends-with/aw'); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); $html = curl_exec($curl); curl_close($curl);
source share