so I'm using simple_html_dom to parse a page for elements with a particular class. I successfully retrieve those elements but cannot seem to get them converted into usable variables (ie an integer so I can do an 'if' statement).
It seems they are an object of some kind, and I've searched everywhere for hours, but no luck. There doesn't seem to be much support for simple_html_dom.
Here's my code:
///////////////
$html = new simple_html_dom();
// Load a file
$html->load_file($getURL);
$getName = $html -> find('.ddlabel', 0);
$getSeats = $html->find('.dddefault', 3);
///////////////
$scraped_name = "$getName";
$scraped_seats = "$getSeats";
$seats = intval($scraped_seats);
echo $scraped_name . "<br>" . $scraped_seats . "<br><br>";
echo gettype($seats) . "<br>" . $seats . "<br>";
// If seats are avavilable, send a message
if ($seats !== 0) { ... }
Some of the echos are just for purposes of me trying to figure this out. Also I might add that all this code in in a foreach() loop, not sure if that matters. I'm reading a csv file of things to append to a url and that's what the foreach() loop is for. But I don't think that's messing with the problem I have.
Thanks for any help!
According to the documentation you would have to extract the content: