Answer the question
In order to leave comments, you need to log in
How to create a parser?
I've been suffering for a long time, trying to compose a parser, but I'm stuck on regular expressions...
I'm trying to get a link to the background image of the VK group (let's say from the group https://vk.com/officialpages) in order to put it on the site and it was updated when the admin will update the background image in the group
.... it is in style, I want to get at least the entire block and remove the unnecessary part from there using substr, but if you tell me how to pull out the link directly, I will be grateful.
The parser itself produces an empty page:
$content = file_get_contents('https://vk.com/officialpages');
preg_match_all ('|<div class="page_block"><[^>]+>(.*)</[^>]+></div>|isU', $content, $content2, PREG_SET_ORDER);
echo $content2['0']['1'];
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question