0
votes

I have one sharepoint list which contains many rows, i used to import that list data using 'export to excel' option in sharepoint manually. now, i am planning to automate that using python. i have python code below to access my company sharepoint url. it is accessing without any issue.

but, i am not sure how to import that sharepoint list data. i tried 'requests.content' and 'requests.text'. both are giving some bytes related information.

please guide me, how can we import the sharepoint list data or items into excel sheet. my sharepoint list contains many rows and columns.

import requests
from requests_negotiate_sspi import HttpNegotiateAuth

r = requests.get('Mysharepoint_Url', auth=HttpNegotiateAuth())

1

1 Answers

0
votes

The bytes might be what you are looking for. Try printing them out with something like:

from base64 import b64decode
import requests
from requests_negotiate_sspi import HttpNegotiateAuth

r = requests.get('Mysharepoint_Url', auth=HttpNegotiateAuth())

decodedmessage1 = b64decode(r.content)
decodedmessage2 = b64decode(r.text)

print(decodedmessage1)
print(decodedmessage2)