Skip to content
Advertisement

Append data in Excel using Python Selenium Openpyxl

I have a sheet with 5 registration numbers, which are successfully being entered into the webpage search, and the code runs without errors while iterating using a ‘For’ statement for each row in the ‘A’ column (Col=0).

I am now trying to append the colour returned by the code into the corresponding row in the ‘B’ column (col=1)

The code I have written (With previous help here) is below:

JavaScript

The code which brings back the colour and prints is:

JavaScript

Is there a simple way to get this Character value into the adjacent row that I’m not seeing? I’m assuming I just something similar to:

JavaScript

However, I don’t think this will work as the colour value hasn’t been set to a variable. Any ideas on a working solution?

Advertisement

Answer

In excel, first cell (first row and first column) is 1,1 there is not 0 column or 0 row

Is this helpful

JavaScript

as you can see, you can use ws.cell(row=row,column=1).value

Advertisement