Home python Caused by SSLERROR error (SSLERROR (1, ' WRONG VERSION NUMBER (_SSL.C: 1129)'))...

Caused by SSLERROR error (SSLERROR (1, ‘[SSL: WRONG_VERSION_NUMBER] WRONG VERSION NUMBER (_SSL.C: 1129)’)) Python Requests

Author

Date

Category

Making a parser on Python Requests using a proxy. When I transmit only the HTTP parameter – everything works, but if I transmit HTTP, and HTTPS – I get an error

Caused by SSLERROR (SSLERROR (1, '[SSL: WRONG_VERSION_NUMBER] WRONG VERSION NUMBER (_SSL.C: 1129) '))

Here is the code:

session = requests.session ()
proxy_auth = httpproxyauth ("Login", "Password")
With Open ("User-Agent.txt") as user_agent_file:
  User_Agent = Eval (User_Agent_File.Read ())
Get_Headers = {'User-Agent': Choice (User_Agent)}
With Open ("proxy_list.txt") as proxy_list_file:
  proxy_list = proxy_list_file.read (). Strip (). Split ('\ n')
proxy = {'https': F'Https: // {proxy_list [0]} ',' http ': F'Http: // {proxy_list [0]}'}
ip_checker = session.get ('http://icanhazip.com', headers = get_headers, proxies = proxy, auth = proxy_auth, verify = false) .text
Print (IP_Checker)
Sleep (Uniform (1,2))
session.cookies.clear ()
HTML = session.get (F'Https: //www.avito.ru/rossiya/avtomobili/bmw? Cd = 1 & amp; p = {i} ', headers = get_headers, proxies = proxy, auth = proxy_auth, verify = false ) .text

Checking a request for http://icanhazip.com – no errors, print displays IIP proxy. I make the next request to the site you need to pars – catch a mistake. Proxy paid, from the site https://proxy6.net/en . Verify = False does not affect the result. What could be the case and how to solve the problem?


Answer 1

helped change the Proxy parameter with

{'https': F'Https: // {proxy_list [0]}', 'http': f 'http: // {proxy_list [0]}'}

on

{'https': F'Http: // {proxy_list [0]}', 'http': f 'http: // {proxy_list [0]}'}

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