1
PHP專家。php的錯誤simple_html_dom解析器
我在使用simple_html_dom類時發現錯誤。
我的html字符串必須解析就像這樣。
<!DOCTYPE html>
<html lang="en">
<head>
<title>Y-shaped ZnO Nanobelts Driven from Twinned</title>
<meta name="site" content="Reports"/>
<meta name="description" content="Description with twinned planes {11&#"/>
<meta name="image" content="https://cdn.sstatic.net/Sites/stackoverflow/img/apple-touch-icon.png?v=c78bd457575a"/>
...
</body>
</html>
我試圖用find(「meta [name = image]」)獲得名爲image的meta標籤,但是我不能。
我檢查了原因,發現它是因爲上面這行中間的字符'&#'。
<meta name="description" content="Description with twinned planes {11&#"/>
我得到了元標記一樣,
Description with twinned planes {11&#"/> <meta name="image" ....
因此,在這種情況下,內容屬性,我應該讓simple_html_dom正確解析HTML嗎?
否則是否有任何其他庫來正確解析此html?
是不是一個問題是,{11&#應該是{11 &# –