繁体   English   中英

如何在 Google 电子表格 API 中获取范围的超链接?

[英]How can I get a range's hyperlink in Google Spreadsheets API?

如何获取 B3:B 范围的超链接并在终端上打印

service = build('sheets', 'v4', credentials=creds)
sheet = service.spreadsheets()

result = sheet.values().get(spreadsheetId="SPREADSHEET_ID",range="Sheet1!B3:B").execute()
values = result.get('values', [])
print(values)

您需要电子表格 ID、工作表 ID ( gid ) 和范围的 A1 表示法。 然后使用正常的字符串操作来构建链接。 最终结果应如下所示:

https://docs.google.com/spreadsheets/d/2t2g9WZsvjP1hqdBte9Cozo0Qrt7PofqSaovMNzES12Q/edit#gid=113010599&range=B3:B

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM