i’m trying try grab the plain text from within <font size="3" color="blue"> … its not picking up the font tag, although it does work if I do “font”, 3 but there are a lot of font tags in the site and i’d like to make the search a bit more specific. is it possible to have multiple attribs on a tag?
<?php
include('simple_html_dom.php');
$html = new simple_html_dom();
$html = file_get_html('http://cwheel.domain.com/');
##### <font size="3" color="blue">Certified Genuine</font>
$element = $html->find("font[size=3][color=blue]", 0);
echo $element-> plaintext . '<br>';
$html->clear();
?>
I dont know Simple_html_dom. But it seems the query you are trying to pass is an xpath query. In that case you need to use prefix attributes with
@. Also you need to prefix the whole query with//to make sure it searches for anyfonttag that is in any level deep. Final query should look something like this.//font[@size=3][@color=blue]Using DOMDocument and DOMXPath it works pretty good.