With jQuery i can fetch the required content from html.
var description = $(".singlePostDescription .description > p:eq(0)").text();
var download_link = $(".row.video-bg .post-title p span:eq(2) a").attr("href");
I'm attempting to do the same thing with PHP DOMDocument.
$dom = new DOMDocument();
$dom->loadHTML($returned_content);
$xpath = new DOMXPath($dom);
$description = $xpath->query('//div[@class="singlePostDescription"]/div[@class="description"]/p[1]');
$download_link = $xpath->query('//div[@class="video-bg"]/div[@class="description"]/p/span[3]/a');
How do i get the text()
for description
and href
for download_link
?