Answer the question
In order to leave comments, you need to log in
Parser html code without libraries, how?
Hello! I need an html parser of someone else's site so that I get all the values of a specific tag (span, div), class, id
They are displayed in the form of an array
There is something like this:
$url = 'ссылка на сайт';
// НАЧАЛО
$ch = curl_init($url);
$html = curl_exec($ch);
curl_close($ch);
var_dump($html);
?>
Answer the question
In order to leave comments, you need to log in
Well, he does the right thing by displaying the entire site. You request the entire html by reference and then display it in its entirety.
And the process of writing a parser "without libraries" will lead to the fact that you write self-made libraries. Moreover, the chances that they will be better than competitors tend to zero.
And I'll tell you a secret: cURL is also a library. Can you rewrite it on sockets from scratch?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question