question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

problem with parsing: HTTPSConnectionPool

See original GitHub issue

I am trying to parse several news webpages. I have no problem with them using requests.get, except with one website: www.redaccionmedica.com.

Expected Result

I would expect that requests.get() worked as expected, with no excepction.

Actual Result

However, this is what really happens when I try to get a webpage from that particular site:


Traceback (most recent call last):
  File "/Users/tomasbaviera/PycharmProjects/Scienceflows/venv/lib/python3.5/site-packages/urllib3/connectionpool.py", line 601, in urlopen
    chunked=chunked)
  File "/Users/tomasbaviera/PycharmProjects/Scienceflows/venv/lib/python3.5/site-packages/urllib3/connectionpool.py", line 346, in _make_request
    self._validate_conn(conn)
  File "/Users/tomasbaviera/PycharmProjects/Scienceflows/venv/lib/python3.5/site-packages/urllib3/connectionpool.py", line 850, in _validate_conn
    conn.connect()
  File "/Users/tomasbaviera/PycharmProjects/Scienceflows/venv/lib/python3.5/site-packages/urllib3/connection.py", line 326, in connect
    ssl_context=context)
  File "/Users/tomasbaviera/PycharmProjects/Scienceflows/venv/lib/python3.5/site-packages/urllib3/util/ssl_.py", line 329, in ssl_wrap_socket
    return context.wrap_socket(sock, server_hostname=server_hostname)
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/ssl.py", line 376, in wrap_socket
    _context=self)
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/ssl.py", line 747, in __init__
    self.do_handshake()
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/ssl.py", line 983, in do_handshake
    self._sslobj.do_handshake()
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/ssl.py", line 628, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLError: [SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:645)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/tomasbaviera/PycharmProjects/Scienceflows/venv/lib/python3.5/site-packages/requests/adapters.py", line 440, in send
    timeout=timeout
  File "/Users/tomasbaviera/PycharmProjects/Scienceflows/venv/lib/python3.5/site-packages/urllib3/connectionpool.py", line 639, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/Users/tomasbaviera/PycharmProjects/Scienceflows/venv/lib/python3.5/site-packages/urllib3/util/retry.py", line 388, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='www.redaccionmedica.com', port=443): Max retries exceeded with url: /noticia/los-medicos-ven-legitimo-prescribir-homeopatia-pero-solo-si-lo-hacen-ellos-93938 (Caused by SSLError(SSLError(1, '[SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:645)'),))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/tomasbaviera/PycharmProjects/Scienceflows/prueba_redaccion_medica.py", line 9, in <module>
    r = requests.get(url)
  File "/Users/tomasbaviera/PycharmProjects/Scienceflows/venv/lib/python3.5/site-packages/requests/api.py", line 72, in get
    return request('get', url, params=params, **kwargs)
  File "/Users/tomasbaviera/PycharmProjects/Scienceflows/venv/lib/python3.5/site-packages/requests/api.py", line 58, in request
    return session.request(method=method, url=url, **kwargs)
  File "/Users/tomasbaviera/PycharmProjects/Scienceflows/venv/lib/python3.5/site-packages/requests/sessions.py", line 508, in request
    resp = self.send(prep, **send_kwargs)
  File "/Users/tomasbaviera/PycharmProjects/Scienceflows/venv/lib/python3.5/site-packages/requests/sessions.py", line 640, in send
    history = [resp for resp in gen] if allow_redirects else []
  File "/Users/tomasbaviera/PycharmProjects/Scienceflows/venv/lib/python3.5/site-packages/requests/sessions.py", line 640, in <listcomp>
    history = [resp for resp in gen] if allow_redirects else []
  File "/Users/tomasbaviera/PycharmProjects/Scienceflows/venv/lib/python3.5/site-packages/requests/sessions.py", line 218, in resolve_redirects
    **adapter_kwargs
  File "/Users/tomasbaviera/PycharmProjects/Scienceflows/venv/lib/python3.5/site-packages/requests/sessions.py", line 618, in send
    r = adapter.send(request, **kwargs)
  File "/Users/tomasbaviera/PycharmProjects/Scienceflows/venv/lib/python3.5/site-packages/requests/adapters.py", line 506, in send
    raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='www.redaccionmedica.com', port=443): Max retries exceeded with url: /noticia/los-medicos-ven-legitimo-prescribir-homeopatia-pero-solo-si-lo-hacen-ellos-93938 (Caused by SSLError(SSLError(1, '[SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:645)'),))

Process finished with exit code 1

Reproduction Steps

The code executed is this one:

import requests
url = "http://www.redaccionmedica.com/noticia/los-medicos-ven-legitimo-prescribir-homeopatia-pero-solo-si-lo-hacen-ellos-93938"
r = requests.get(url)

I have tried also with this other code, but I got the same result:

import requests
url = "http://www.redaccionmedica.com/noticia/los-medicos-ven-legitimo-prescribir-homeopatia-pero-solo-si-lo-hacen-ellos-93938"
r = requests.get(url, Verify=False)

System Information

$ python -m requests.help
/usr/bin/python: No module named requests

My python version is 2.18.4, and I work with a Mac OSX. Any help would be appreciated very much. Thanks in advance.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ghostcommented, Apr 28, 2018

I’m having trouble reproducing this, what version of python are you using?

python -m requests.help
{
  "chardet": {
    "version": "3.0.4"
  }, 
  "cryptography": {
    "version": ""
  }, 
  "idna": {
    "version": "2.6"
  }, 
  "implementation": {
    "name": "CPython", 
    "version": "2.7.10"
  }, 
  "platform": {
    "release": "17.5.0", 
    "system": "Darwin"
  }, 
  "pyOpenSSL": {
    "openssl_version": "", 
    "version": null
  }, 
  "requests": {
    "version": "2.18.4"
  }, 
  "system_ssl": {
    "version": "20000000"
  }, 
  "urllib3": {
    "version": "1.22"
  }, 
  "using_pyopenssl": false
}
>>> url = "http://www.redaccionmedica.com/noticia/los-medicos-ven-legitimo-prescribir-homeopatia-pero-solo-si-lo-hacen-ellos-93938"
>>> r = requests.get(url)
>>> r
<Response [200]>
>>> r = requests.get(url, verify=False)
/private/tmp/.r/lib/python2.7/site-packages/urllib3/connectionpool.py:858: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
  InsecureRequestWarning)
>>> r
<Response [200]>

That’s with Python 2.7.10 on MacOS High Sierra.

Perhaps their web server was temporarily having trouble with SSL.

0reactions
tomasbavieracommented, Apr 28, 2018

Thank you very much for your clarifying comments, @sigmavirus24!!!

Read more comments on GitHub >

github_iconTop Results From Across the Web

problem with parsing: HTTPSConnectionPool #4615 - GitHub
I am trying to parse several news webpages. I have no problem with them using requests.get, except with one website: www.redaccionmedica.com ...
Read more >
There is a problem parsing the package" while installing ...
I've only seen the parsing error when the android version on the device was lower than the version the app was compiled for....
Read more >
snowsql Failed to Execute - Snowflake Community
Hi all,. New to Snowflake caveat! I am trying to connect from the command line for the first time and facing an error....
Read more >
Troubleshooting — conan 1.55.0 documentation
ERROR: Missing prebuilt package¶. When installing packages (with conan install or conan create) it is possible that you get an error like the...
Read more >
How to Fix Parse Error There was a Problem ... - YouTube
I'm gonna show How to Fix Parse Error There was a Problem Parsing the Package 2022 while installing android apps and apks.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found