Hello friends,
I want to grab an href attribute of first anchor tag from this link http://www.sidereel.com/Heroes/_season/4/_episode/11/_search/_links
I am using the code
$fromurl='http://www.sidereel.com/Heroes/_season/4/_episode/11/_search/_links';
$html = getDocument($fromurl);
$dom = new DOMDocument();
@$dom->loadHtml($html);
$xpath = new DOMXPath($dom);
$content = $xpath->query('//a[@class="wl"]');
echo $content->length;
echo 'Title: ' . $content->item(0)->childNodes->item(0)->nodeValue . '<br />';
echo $content->getAttribute('href');
It was working previously but now href attribute value is not appearing. It only shows "Thanksgiving".
I want to grab this value "/Heroes/_watchlinkviewer/37244"
Can you please help me.
Regards
Gotu
Windows 7: Find the right PC for you. Learn more.
I want to grab an href attribute of first anchor tag from this link http://www.sidereel.com/Heroes/_season/4/_episode/11/_search/_links
I am using the code
$fromurl='http://www.sidereel.com/Heroes/_season/4/_episode/11/_search/_links';
$html = getDocument($fromurl);
$dom = new DOMDocument();
@$dom->loadHtml($html);
$xpath = new DOMXPath($dom);
$content = $xpath->query('//a[@class="wl"]');
echo $content->length;
echo 'Title: ' . $content->item(0)->childNodes->item(0)->nodeValue . '<br />';
echo $content->getAttribute('href');
It was working previously but now href attribute value is not appearing. It only shows "Thanksgiving".
I want to grab this value "/Heroes/_watchlinkviewer/37244"
Can you please help me.
Regards
Gotu
Windows 7: Find the right PC for you. Learn more.