Answer the question
In order to leave comments, you need to log in
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)
Answer the question
In order to leave comments, you need to log in
That's how it works
params = {
'detailNum': 'F00VC17503',
'make': 'Bosch',
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question