If a cell contains multiple hyperlinks, the approach mentioned in the following link doesn't work: Extracting Hyperlinks From Excel (.xlsx) with Python
Is there any way to extract multiple hyperlinks in a cell preferably using openpyxl library?
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. Have to use 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}')
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.