Pemburu
Pemburu copied to clipboard
Prevent InsecureRequestWarning
I wanted to use the script, but a warning appeared and prevented the script to run.
/Library/Python/2.7/lib/python/site-packages/urllib3/connectionpool.py:847: 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
After a quick check on StackOverflow, there's a reason: urllib3 not a part of requests anymore. To disable warnings in requests vendored urllib3, we should import the specific instance of the module.
Adding : from requests.packages.urllib3.exceptions import InsecureRequestWarning requests.packages.urllib3.disable_warnings(InsecureRequestWarning) in order to prevent it.