【发布时间】:2023-03-27 16:05:02
【问题描述】:
我尝试这样做:
$html = file_get_html ( 'http://www.ebay.com/cln/explorer/_ajax?page=1&ipp=16&catids=37958' );
foreach ( $html->find ( 'div[class="connection"]' ) as $collection ) {
echo "found collections: ".count($collection);
问题是,AJAX 请求返回的文件包含如下编码的元素:
<div class=\"collection\" data-collectionid=\"75336256016\">
<div class=\"header\">
谁能帮我将 DOM 对象中的所有\" 转换回正常的"。
或更改->find 命令以找到正确的元素。
非常感谢!
【问题讨论】:
-
那个页面给你 JSON 加上最后的 html 评论。