1

Trying to grab the content of website using python 3.6.2.Getting below error.

requests.exceptions.SSLError: HTTPSConnectionPool(host='www.amazon.in', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLError(1, '[SSL: TLSV1_ALERT_ACCESS_DENIED] tlsv1 alert access denied
 (_ssl.c:748)'),))

Code:

import requests
from bs4 import BeautifulSoup
r=requests.get("https://www.amazon.in/")
r.content

Help me in fixing this!

3
  • looks like your system rules access denied in router or by firewall Commented Sep 13, 2017 at 8:07
  • Yup, works for me, which version of python and requests are you using? Commented Sep 13, 2017 at 8:14
  • @JulienPalard python version is 3.6.2, requests module version is 2.18.4. Commented Sep 13, 2017 at 8:26

2 Answers 2

1

try http instead of https. It worked for me

Sign up to request clarification or add additional context in comments.

Comments

0

You can check your connection and ability to communicate with TLS protocol by typing following command:

openssl s_client -connect www.amazon.in:443

Anyway, your python code is correct and works for me.

1 Comment

>>> openssl s_client -connect www.amazon.in:443 File "<stdin>", line 1 openssl s_client -connect www.amazon.in:443 ^ SyntaxError: invalid syntax

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.