0

I just want to read a public google doc without username and password. I have url of gdoc sheet which is public, I want to read that doc in python.

I have tried that using following code.

from gspreadsheet import GSpreadsheet
url = "https://docs.google.com/spreadsheets/d/1101qb2Vz0ZW7cjnTpjBpOP71wy7iOcXdqPug0F37xYA/edit#gid=0"

reader = GSpreadsheet(url=url)
for row in reader:
    print(row)

it is throwing following exception:

! not a valid url: https://docs.google.com/spreadsheets/d/1101qb2Vz0ZW7cjnTpjBpOP71wy7iOcXdqPug0F37xYA/edit#gid=0
Traceback (most recent call last):
  File "C:/Users/Abdul/PycharmProjects/examples/main.py", line 4, in <module>
    reader = GSpreadsheet(url=url)
  File "C:\Python27\lib\site-packages\gspreadsheet\gspreadsheet.py", line 191, in __init__
    self.key = re.search(r'key=([0-9a-zA-Z\-]+)', url).group(1)
AttributeError: 'NoneType' object has no attribute 'group'

Note: I don't want to use email/password for this task.

2

0

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.