Hello. There is a big html file. I bring it to the page by code
$file = file_get_contents('./file.html', FILE_USE_INCLUDE_PATH); As a result, the entire HTML code of the file is displayed. But I don’t need all the code, I just need such a block from this code:
<TBODY class="content"> <TR CLASS="offline" id="" nopoll=""> <TD>тут контент</TD> </TR> <TR CLASS="online" id="" nopoll=""> <TD>тут контент</TD> </TR> <TR CLASS="connect" id="" nopoll=""> <TD>тут контент</TD> </TR> </TBODY> How to display on the page only this block?
Initially I wanted to use Simple HTML DOM Parser - but it doesn’t fit, since HTML files sometimes come non-standard, and it gives an error Call to a member function find() on a non-object
domDocumentand Xpath//TBODY[@class="content"]- splash58find()that you are calling on a non-nullvalue? - teran<tbody>and discard all unnecessary. the fastest way will be. - teran<tbody>? - entithat