I am attempting to extract a specific CSS class from my DOM object using the simplehtmldom library.
1) The library
simplehtmldom.sourceforge.net
2) Since my localhost does not support fopen for some reason, I am utilizing the CURL library to retrieve the HTML. Here is the source:
3) At present, my script appears as follows. It fetches the HTML source from the desired website.
<?php
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, "http://hokejbal.cz/1-liga/tabulky/");
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($curl);
curl_close($curl);
print $result;
str_get_dom;
$ret = $html->find('.standings tablesort tablesorter tablesorter-default');
?>
4) My goal now is to extract only a section of the website. Specifically, this table:
<table class="standings tablesort tablesorter tablesorter-default">
I identified it in the Google Chrome webmaster tools.
Regrettably, when I execute the script, I receive the entire HTML page instead of just the targeted portion. What could be the issue?