Answer the question
In order to leave comments, you need to log in
What is the reason for the refusal to parse by url?
I don't know how to ask the right question.
Through cURL, I get a catalog of goods from a JSON source and save the goods to my database.
I ran into an inexplicable problem, parsing from different urls behaves differently, despite the fact that the difference in the url is only one digit, for example:
site.ru/market/ware?page=1&category= 1
and
site.ru/market/ware? page=1&category= 11
The second link, more precisely, parsing on it works 100%, parsing on the first link does not want to work, although the JSON content is completely identical .
The whole day I could not understand what the reason was, I determined the reason only by searching the addresses, the result is higher.
Tell me, what could be the problem, because of which category=1 does not want to work?
I thought about how you can change the url to parse from category 1, but I couldn’t think of anything.
The category number is inserted like this
for ($page = 1; $page <= 50; $page++) {
$item = $ware->getMarket('1', $page);
$response = (array)@json_decode($this->request('GET', 'http://site.ru/market/ware?page=' . $page . '&category=' . $category)['body'], true);
$response = (array)@json_decode($this->request('GET', 'http://site.ru/market/ware?category=' . $category . '&page=' . $page)['body'], true);
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