我想解析一些表數據,但該表沒有類或固定的數字,所以我試圖通過使用next_sibling()
方法來捕獲它。PHP的HTML簡單的DOM分析器返回NULL
但是,如果我找到一個標準的表,它將返回null。我的代碼中有錯誤嗎?
<table class="prettytable mx-auto rounded text-center">
這是我想找的那一行。
我試過這兩個代碼:
$html_pokemon->find('table.prettytable.mx-auto.rounded.text-center')
$html_pokemon->find('table[class=prettytable mx-auto rounded text-center]')
我做了什麼錯?
打印$ html_pokemon並查看得到的結果 –
$ html_pokemon獲取正確的數據但找到了錯誤 – ChairOfOnbi
數據實際上是否包含相同類的相同表? –