【发布时间】:2015-12-08 14:08:53
【问题描述】:
我遇到了 PHP 简单 HTML dom 解析器的问题。 我找到一个带有 ® 符号的 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# 进行了测试,效果很好!! 谢谢你的帮助!
【问题讨论】:
-
你确定源中有®符号吗?因为如果您回显它并从那里获取 id,浏览器可以将
&reg设为该符号!
标签: javascript php html html-parsing