Parsing an HTML page in Wordpress and PHP, how do I select a specific table? -
parsing html page in wordpress , php, how select specific table? right now, request specific page, , able return "body" section code.
however, i'd return "mytable" fragment.:
<table id="mytable" class="display" table width="60%" border="1">
my code:
$response = wp_remote_get( $request_url ); return $response['body'];
html looks similar this:
<html> … <body> <table id="mytable" class="display" table width="60%" border="1"> <thead> <tr> <th>number </th> <th>description</th> </tr> </thead> <tbody> <tr> <td>123456789101112</td> <td>foobar makes best foo ever barred!</td> </tr> </tbody> </table> </body> </html>
Comments
Post a Comment