If you're unsure whether you're using PHP, here's a method to extract information from a webpage containing CSS properties. It's important to obtain permission from the site in order to avoid overloading their server with repeated accesses to property pages. The code below is limited to displaying only 10 results. While utilizing the "ob" functions may not be the most elegant solution, it gets the job done.
<?php
ini_set('max_execution_time', 600);
ob_end_clean();
ob_implicit_flush(true);
libxml_use_internal_errors(true);
function getValuesForElement($element) {
$valueArray = [];
try {
$dom = new DOMDocument();
$dom->preserveWhiteSpace = false;
$dom->loadHTMLFile('http://css-infos.net/property/' . $element);
$data = $dom->getElementsByTagName('code');
foreach($data as $css) {
$val = preg_replace("/\s+/S", "", $css->nodeValue);
if(!empty($val)) {
$valueArray[] = $val;
}
}
} catch(Exception $e) {
// Log error..
}
return $valueArray;
}
function getElements() {
try {
$i = 0;
$elementsArr = [];
$dom = new DOMDocument();
$dom->preserveWhiteSpace = false;
$dom->loadHTMLFile('http://css-infos.net/');
$data = $dom->getElementsByTagName('li');
foreach($data as $css) {
if($i === 10) {
break;
}
$nodeVal = $css->nodeValue;
if($nodeVal == "Webkit CSS properties") {
continue;
}
$elementsArr[$nodeVal] = getValuesForElement($nodeVal);
echo "getting <strong><em>".$nodeVal."</em></strong> values..\n";
$i++;
sleep(1);
}
} catch(Exception $e) {
// Log error..
}
print_r($elementsArr);
}
echo "<pre>";
getElements();
die();
?>