Answer the question
In order to leave comments, you need to log in
How to parse goods?
Hello. I have such a page, on which goods are loaded by a post request from here hobbygames.ru/?route=lib/feed/products with such data.
I'm trying to get like this
$postdata = array(
'saveState' => true,
'state' => array(
'page' => 10,
'sort' => 'no_sort',
'order' => 'ASC',
'all' => true,
'excluded_products' => [34580],
'excluded_categories' => [27610, 26879, 26993, 27916],
'results_per_page' => 100
)
);
$opts = array('http' =>
array(
'method' => 'POST',
'header' => 'Content-type: application/json; charset=utf8',
'content' => $postdata
)
);
$context = stream_context_create($opts);
$result = file_get_contents('http://hobbygames.ru/?route=lib/feed/products', false, $context);
print_r(json_decode($result)->rendered);
curl -i -X POST -H "Content-Type: application/json" -d "{"saveState":true,"state":{"page":2,"results_per_page":100,"sort":"no_sort","order":"ASC","all":true,"excluded_products":[34580],"excluded_categories":[27610,26879,26993,27916]}}" http://hobbygames.ru/?route=lib/feed/products
Answer the question
In order to leave comments, you need to log in
I decided on my own, it was necessary to convert post data to json
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question