[英]Extract multiple hyperlinks from a cell of xlsx file using openpyxl
If a cell contains multiple hyperlinks, the approach mentioned in the following link doesn't work: Extracting Hyperlinks From Excel (.xlsx) with Python如果单元格包含多个超链接,则以下链接中提到的方法不起作用: Extracting Hyperlinks From Excel (.xlsx) with Python
Is there any way to extract multiple hyperlinks in a cell preferably using openpyxl library?有没有办法最好使用 openpyxl 库在一个单元格中提取多个超链接?
If it is done by shapes, I don't know of any other way to have multiple hyperlinks in the same cell, then Openpyxl cannot do.如果它是通过形状完成的,我不知道在同一个单元格中有多个超链接的任何其他方法,那么 Openpyxl 不能做。 Have to use Xlwings.
必须使用Xlwings。
import xlwings as xw
wb = xw.Book('foo.xlsx')
ws = wb.sheets('Sheet1')
for shape in ws.api.Shapes:
print(f'Hyperlink: {shape.Hyperlink.Address}')
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.