[英]Simple PHP Dom Parser to find HTML ID with symbols
我有PHP简单HTML dom Parser的问题。 我找到带有®符号的html ID,但API无法识别(此类存在于html文件中)。
?>
header('Content-Type: text/html; charset=UTF-8');
require 'simple_html_dom.php';
$html = file_get_html('http://ark.intel.com/products/88194/Intel-Core-i7-6500U-Processor-4M-Cache-up-to-3_10-GHz');
//There is the problem on the ® symbol.
foreach($html->find('div#infosectionintel®platformprotectiontechnology-scrollpane') as $protection) {
$item8['osguardxx'] = $protection->find('tr#OSGuardTechVersion td.rc', 0)->plaintext;
$item8['txtxxxxxx'] = $protection->find('tr#TXT td.rc', 0)->plaintext;
$item8['exedisbit'] = $protection->find('tr#ExecuteDisable td.rc', 0)->plaintext;
$protections[] = $item8;
}
print_r($protections);
?>
我用其他div#测试没有符号,效果很好!! 谢谢你的帮助!
您可以使用chr($ascii)
(将ascii替换为带ascii代码的®),也可以使用以下通配符:
foreach($html->find('div[id*=infosectionintel]', 0) as $protection) {
并且它将寻找任何infosectionintel
名称infosectionintel
div id。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.