0

I am trying to get data from .xlsb file in an authorized website. But it comes out with error message: 'HTTP Error 401: Unauthorized'. What should I do to authorize so that the data comes out in pandas table in Python? Here the code that I tried so far:

supplier_list_xlsb = pd.read_excel('https://..../3026744.xlsb', sheet_name = 'xxxxxx',engine = 'pyxlsb')

2 Answers 2

1

Clear your browser's cache may be that will help resolve this issue.Are you sure website is authorized to access?

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

1 Comment

Yes Rav. I already log in the website via browser but it seems not working when I try to extract using python code.
0

I already got the answer. I need to use NTLM authentication (instead of basic) to download the file and use the downloaded file into Pandas to get the table. Here is the code:

import requests
from requests_ntlm3 import HttpNtlmAuth

auth=HttpNtlmAuth('username','password')
myfile = requests.get("https://..../3026744.xlsb", auth=auth)

open('C:/Users/Desktop/test/Supplier.xlsb', 'wb').write(myfile.content)

supplier_list_xlsb = pd.read_excel('C:/Users/Desktop/test/Supplier.xlsb', sheet_name = 'xxxxxx',engine = 'pyxlsb')

Comments

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.