I'm using PHP Simple HTML DOM Parser to parse an HTML file, but I'm unable to parse the "data-extension" attribute of an "a" tag. The HTML looks like this:
<a href="/websitenews.html" class="video" data-extension='{"mediaObj":{"url":"http://a-website.com/ondemand/226/217.js","offset":"0.0"}}' title="Video start">
My PHP code looks like this:
foreach($html->find('a[class=video]') as $e) {
echo $e->data-extension;
}
But all it is echoing is a series of zeros. How can I echo the url within the data-extension, i.e., "http://a-website.com/ondemand/226/217.js" ? Thanks.