I want to get a HTML document from a remote website using curl, and parse it via php.
About curl, I know how to do it, but when I get the HTML document in a php string, how can I parse it getting certain elements? (like js queryselector)
@NogDogJun 20.2019 — #https://php.net/DOM is the most robust approach, though it's a bit intimidating when you first look at the documentation. :) Ultimately it's similar to parsing the DOM in JavaScript/jQuery, though.
@SempervivumJul 01.2019 — #DOMDocument's parser doesn't know about the new semantic tags of HTML5 (yet?). However I experienced that the document is parced successfully in spite of these errros and that these tags can be accessed.
@SempervivumJul 01.2019 — #PS: I want only to parse some <meta> tags in head of html document to withdraw the contents.[/quote] Check if the function get_meta_tags can do this