L
L
lemonlimelike2020-06-28 00:09:26
Python
lemonlimelike, 2020-06-28 00:09:26

Why can't the query retrieve an array element?

I am writing a parser for the emex.ru website. The site works on the API. I wrote a little code, for you personally, so that you can see the problem.

Here is my code:

import requests
import json
str_req = f"https://emex.ru/api/search/search"
item_request = requests.get(str_req,
    params={
        'detailNum':'F00VC17503',
        'make':'bosch',
    },
    headers={
            'Accept': 'application/json, text/plain, */*',
            'Accept-Encoding': 'gzip, deflate, br',
            'Accept-Language': 'ru-RU,ru;q=0.9,en-US;q=0.8,en;q=0.7',
            'Connection': 'keep-alive',
            'Host': 'emex.ru',
            'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.106 Safari/537.36',
        })
content_str = item_request.content.decode('utf-8')
content_json = json.loads(content_str)
print(content_json)


The essence of the problem: requests through python do not receive another element, these are points. If you go to this url through the browser, then points will be there. Attached a

screen that shows that I don’t have this points in the console, but I do in the browser. How to get to this points?
5ef7b57049228026323052.png

I thought that the problem was in the headers, added, the problem remained. I thought that the parameters were some left, then I removed some, the problem remained. Help

I don't really want to use selenium, because there is an API

In general, how is it possible that not all data comes through reqeuests python? And through a normal browser everything comes

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
ScriptKiddo, 2020-06-28
@lemonlimelike

That's how it works

params = {
    'detailNum': 'F00VC17503',
    'make': 'Bosch',
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question