New posts are disabled while we improve the user experience.

You can browse the site, or for urgent issues, raise a query at MyAccount.

question

Upvotes
1 0 0 0

Error code 403 | Client Error

Hi,


When I run below code,

1730758833250.png


I do see below error message


2024-11-04 17:20:09,235 P[42128] [MainThread 46476] Error code 403 | Client Error: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><!-- Message.TemplateName: URLBlocked Message.Language: --><html><!-- head --><head> <meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/> <title>McAfee Web Gateway - Notification - Access to this site has been BLOCKED by CA-CIB Internet Usage Policy</title> <script src="/mwg-internal/de5fs23hu73ds/files/javascript/sw.js" type="text/javascript" ></script> <link rel="stylesheet" type="text/css" href="/mwg-internal/de5fs23hu73ds/files/intel/stylesheet.css" /></head><!-- /head --><!-- body --><body onload="swOnLoad();"> <!-- wrapper --> <div class="wrapper"> <!-- logo --> <div class="logo"><a target='_blank' href='http://172.16.113.24:80/checkurl?URL=http://127.0.0.1:9060/api/v1/data&local=checked&cloud=checked'> <img src="/mwg-internal/de5fs23hu73ds/files/intel/img/CACIB_Logo.png" style="border-style: none" alt="McAfee Web Gateway"/></a>

...

</body><!-- /body --></html>


---------------------------------------------------------------------------EikonError Traceback (most recent call last)c:\Program64\Python\Python\lib\site-packages\eikon\json_requests.py in send_json_request(entity, payload, debug) 126 else:--> 127 _raise_for_status(response) 128 except httpx.TimeoutException as timeout_exception:c:\Program64\Python\Python\lib\site-packages\eikon\json_requests.py in _raise_for_status(response) 270 logger.error(u'Error code {} | {}'.format(response.status_code, error_msg))--> 271 raise EikonError(response.status_code, error_msg)EikonError: Error code 403 | Client Error: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><!-- Message.TemplateName: URLBlocked Message.Language: --><html><!-- head --><head> <meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/> <title>McAfee Web Gateway - Notification - Access to this site has been BLOCKED by CA-CIB Internet Usage Policy</title> <script src="/mwg-internal/de5fs23hu73ds/files/javascript/sw.js" type="text/javascript" ></script> <link rel="stylesheet" type="text/css" href="/mwg-internal/de5fs23hu73ds/files/intel/stylesheet.css" /></head><!-- /head -->

...

</body><!-- /body --></html>


how can I solve this issue? do I need to key in proxy setting? thanks.

#technologypython api
1730758833250.png (15.5 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

· Write an Answer
Upvotes
15.6k 33 5 10

Hi @max.kang ,

Eikon Data API needs to connect to the Workspace/Eikon desktop application that is up and running on the same machine (localhost) because the desktop application acts as a proxy between the API and Workspace platform.

The error messages indicate that the issue relates to the McAfee Web Gateway in your machine. The McAfee software in your machine might intercept this request and reject it. You may need to contact your local IT support team to verify this issue.

However, some users can solve this issue by setting the NO_PROXY environment variable.

import os
os.environ['NO_PROXY'] = '127.0.0.1'

If the setting above does not solve the issue, I highly recommend you contact your local IT support team.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.