Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there jsoup-like HTML parser for PHP?

I need HTML parser for PHP that can use CSS selectors to select elements, in Java we have jsuop. Is there such a library for PHP?

like image 934
newbie Avatar asked Jun 10 '11 08:06

newbie


People also ask

Can jsoup execute JavaScript?

jsoup will not run JavaScript for you - if you need that in your app I'd recommend looking at JCEF.

What is jsoup parser?

jsoup is a Java library for working with real-world HTML. It provides a very convenient API for fetching URLs and extracting and manipulating data, using the best of HTML5 DOM methods and CSS selectors.

What is jsoup used for?

What It Is. jsoup can parse HTML files, input streams, URLs, or even strings. It eases data extraction from HTML by offering Document Object Model (DOM) traversal methods and CSS and jQuery-like selectors. jsoup can manipulate the content: the HTML element itself, its attributes, or its text.

What is Dom in jsoup?

Where. document − document object represents the HTML DOM. Jsoup − main class to parse the given HTML String. html − HTML String. sampleDiv − Element object represent the html node element identified by id "sampleDiv".


1 Answers

Try phpQuery; it uses CSS-style selection similar to jQuery, which by the sound of your description is similar to jsoup.

like image 129
Matt Gibson Avatar answered Oct 12 '22 01:10

Matt Gibson