How do I get images of an embedded cell?
I try to use openpyxl to read an excel file with an image embedded in K3 cell. But the ws._images
is an empty list. I can't get the image and its coordinate.
import os
from openpyxl import load_workbook
TEST_DIR = os.path.dirname(__file__)
TEST_XLSX_FILE_PATH = os.path.join(TEST_DIR, './assets/data.xlsx')
def test_read_xlsx():
"""Test read_xlsx"""
wb = load_workbook(
filename=TEST_XLSX_FILE_PATH,
rich_text=True,
data_only=True,
read_only=False)
ws = wb['Sheet1']
print(ws._images)
The test file: data.xlsx