0

I have the following code. Which shows the webpage in php.

<?php


$ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, "http://jobseekers.direct.gov.uk/listjob.aspx?sessionid=94d5cfde-f7f1-40e9-bef6-2f587b4f04b0&pid=4&sid=421116805&p=1&so=1&rpp=20");
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
    $curled=curl_exec($ch);
    curl_close($ch);
print_r($curled);

?>

I want to take the elements such as the job role out with cURL. I would like to make a list of all the roles, but I know how to do that from watching a tutorial. The job roles are embedded in the TD class

user1781162
  • 91
  • 2
  • 5
  • 1
    Post a sample of the HTML to be parsed. You will need to use a DOM parser like [DOMDocument](http://php.net/manual/en/class.domdocument.php). – Michael Berkowski Nov 14 '12 at 00:55
  • If it helps, Xpath is a really handy way to navigate elements contained within a DOMDocument. XPath and CSS Selectors basically do the same thing - identify html elements, but in this case an XPath query on a DOMDocument will return the required elements. – adomnom Nov 14 '12 at 01:13

1 Answers1

0

So what you want to do is actually HTML parsing, CURL is just for fetching the page. Check this post out as a good starter.

I would personally recommend using SimpleDom which enables you to apply css selector-based syntax on your HTML document.

Community
  • 1
  • 1
David Müller
  • 5,291
  • 2
  • 29
  • 33