I am learning scraping using the PHP Simple HTML DOM Parser and Xpath. Accroding to the changelog given here http://sourceforge.net/news/?group_id=218559. The PHP SImple HTM
There's find function in Simple HTML DOM Parser. BUT it accepts selectors! So you cant just write
$html = file_get_html($link);
$elements = $html->find("/html/body/div/p");
because then you'll get more than one element!
to get just exact element marked by XPath, write
$element = $html->find("/html/body/div[1]/p[1]", 0);