0
你可以用“php简单的html dom”取一段HTML而不仅仅是内容吗?用PHP提取纯HTML简单的HTML DOM解析器
我与特里:
foreach ($html->find('div.info-bar') as $infop) {
$info = $infop->plaintext;
}
不幸的是,输出是:
24级奖杯4201铜奖2725银1057黄金341白金78 等级24 66 66%
虽然我想提取纯粹的HTML ..
这是我的代码:
include('simple_html_dom.php');
$html = file_get_html('https://my.playstation.com/obaidmiz04');
foreach ($html->find('div.info-bar') as $infop) {
$info = $infop->plaintext;
}
echo $info;
你可能想将字符串添加到'$ info'变量中,而不是覆盖它。所以在循环中使用'。='而不是'='。 – ferdynator
我试过了,但继续只打印文本而不是html ... – Xanger