I have some values in a Google Sheet, some of which are hyperlinked, like the third one here:
I want to retrieve the text value of each cell, and the hyperlink if present.
I am able to access the sheet easily enough with gspread:
import gspread
from oauth2client.service_account import ServiceAccountCredentials
scope = ['https://spreadsheets.google.com/feeds']
credentials = ServiceAccountCredentials.from_json_keyfile_name(
'./credentials.json', scope)
gc = gspread.authorize(credentials)
key = 'xxxxx'
wks = gc.open_by_key(key).worksheets()
for wk in wks:
links = wk.col_values(3)
for l in links:
print l.value
However, this only prints the string value of the links, not the actual href that the link is pointing to.
Does anyone know if it's possible to retrieve this programmatically, using gspread or another library?