-
Notifications
You must be signed in to change notification settings - Fork 166
Jsoup Extension
Dmitriy Zayceff edited this page Apr 17, 2015
·
13 revisions
API: http://jphp-docs.readthedocs.org/en/latest/api_en/php/jsoup/
Jsoup is a library for working with real-world HTML. It provides a very convenient API for extracting and manipulating data, using the best of DOM, CSS, and jquery-like methods. It based on the jsoup java library jsoup.org
Getting and parsing text of url
use php\jsoup\Jsoup;
$doc = Jsoup::connect("http://en.wikipedia.org/").get();
$newsHeadlines = $doc->select("#mp-itn b a");
foreach ($newsHeadlines as $element) {
echo "- {$element->text()}\n";
}JPHP Group 2015