Home python How to Poule Yandex.Market on Python.Bank 403

How to Poule Yandex.Market on Python.Bank 403




Hello everyone. Troubles with Parsing Yandex.Market. I want to pair the phone. When I appeal to Yandex.Market, he returns to me 403 response, that is, a failure in access. Everything HTML code that I want to get it to paint it, I get the HTML code in which I tell Yandex that they say my PC is infected (actually With my PCs all the rules). Well, and accordingly, to make the rules parser not get out of 403 errors. With other sites, it turns out and all the rules, but with Yandex some problems with me. How can I get around this error?

Link to Parsing page – https://market.yandex.ru/catalog–SmartFony/16814639/list?hid=91491&glfilter=16816262%3a16816264&amp ;onstock=1

import requests
Import BS4.
Headers = Requests.utils.default_headers ()
Headers.update ({'User-Agent': 'Mozilla / 5.0 (Windows NT 10.0; Win64; x64) AppleWebKit / 537.36 (KHTML, LIKE GECKO) Chrome / 83.0.4103.116 Safari / 537.36'})
url = "https://market.yandex.ru/catalog--Smartfony/16814639/list?hid=91491&glfilter=16816262%3a16816264& ;onstock=1"
R = Requests.get (URL, Headers)
R.ENCoding = "UTF8"
Soup = BS4.BeautifulSoup (R.Content, "HTML.PARSER")
Sel = Soup.Select ("div.d0n9pzyfeg a")
For i in sel:
  Print (I)

Answer 1, Authority 100%

killed some kind of catostrophic amount of time to pull out data. What is the reason was that the script did not work for me, I did not fully fully. Most likely it was the problem with certificates. Started from under systemic python and everything worked.

Specify all the headlines that I have

import requests
url = "https://market.yandex.ru/catalog--Smartfony/16814639/list?hid=91491&glfilter=16816262:16816264& ;onstock=1"
Headers = {
'Accept': 'text / html, application / xhtml + xml, application / xml; q = 0.9, image / webp, image / apng, * / *; q = 0.8, application / signed-exchange; v = b3; q = 0.9 ',
'Accept-Language': 'RU-RU, RU; Q = 0.9, EN-US; Q = 0.8, EN; Q = 0.7',
'Connection': 'Keep-Alive',
'Host': 'market.yandex.ru',
'SEC-Fetch-Dest': 'Document',
'SEC-Fetch-Mode': 'Navigate',
'SEC-Fetch-site': 'none',
'Sec-fetch-user': '? 1',
'Upgrade-insecure-requests': '1',
'User-Agent': 'Mozilla / 5.0 (x11; linux x86_64) AppleWebKit / 537.36 (KHTML, LIKE GECKO) Chrome / 83.0.4103.61 Safari / 537.36',
Response = Requests.Request ("Get", URL, Headers = Headers)
Print ('UTF8'))
Print (response.status_code)

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions