Z
Z
ZaurK2017-06-10 11:30:04
Parsing
ZaurK, 2017-06-10 11:30:04

Why am I getting 400 Bad Request?

Hello! Not strong in parsing, so I ask for advice from experienced professionals. When a page of a site is requested by the curl, I get and display its content. There is a button on the site, when you click on it, the list of products is dynamically loaded in 20 pieces, I tracked it in the chrome debugger and found that there are some parameters that are most likely related to loading content with Ajax.
4a28c8393347446ea77065657a9b490f.png
Do I understand correctly that these are post-parameters? If so, then I pass them to the request

$post = array(
'act' => 'data-more',
'page' => '3', 
'eng' => '44536', 
'sys' => 'guest', 
);

$html = request('http://www.site.ru', $post);
echo $html;


but I get a 400 Bad Request error. If instead of $post send null , then I get the page I'm looking for but with 20 products. How can I get a page with at least 40 products? Where is the mistake?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Denis Artamonov, 2017-06-16
@ArtamonovDenis

Do I understand correctly that these are post-parameters? If so, then I pass them to the request

1. On the basis of what did you understand this?
2. what does the request function do?
3. 400 Bad Request

Z
ZaurK, 2017-06-16
@ZaurK

Thanks to everyone for the answers, the issue has already been resolved, fixed the entry 'Accept: application/json, text/javascript, */*; q=0.01',

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question