D
D
Dmitriy2019-08-01 18:54:30
PHP
Dmitriy, 2019-08-01 18:54:30

How to parse a photo from a site, maybe with JSON?

https://becompact.ru/tovary/noutbuk-msi-gp63-leopa...
This is a product link, the product has a photo in the slider, slick slider,

$images = $pw->find('div.photos > div.slider-for3 div.slick-list.draggable div.slick-track > div.item');
echo $images;

This is how I try to display photos in order to see what they are displayed.
phpQuery library. How can I get them out?
I think they connect after loading the site, how can I parse them?
Maybe via JSON, then how do I get it?
$json = file_get_contents('url');
$array = json_encode($json);
print_r($array);

I tried instead of print_r, var_dump and echo, it still doesn't output anything, help me decide.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
T
ThunderCat, 2019-08-01
@ThunderCat

hint: it makes no sense to look at the rendered html, look at the source of the page.

E
Exploding, 2019-08-01
@Exploding

Press F12, look at the Console tab and see how it is written in red on pink to us:
What does it mean in translation: what the hell is file_get_contents! Use cURL!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question