简体   繁体   中英

Python - TypeError: object of type 'Cell' has no len()

I am working on Selenium with Python.

I am writing a code which will fetch the data from an excel file and punch the same data on the WebPortal. But I am getting the error:

TypeError: object of type 'Cell' has no len()

Below is the code:

for X in range(1,rowCount):
    for Y in range(0,colCount):
        cellData = worksheet.cell(X,Y)

        driver.find_element_by_id("XYZ").send_keys(cellData)

You're passing a cell object where a string is expected.

Try this instead:

cellData = worksheet.cell(X,Y).value

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.

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