'How do you write the lest cell of the row you just used in python to a excel file and to tell python to ignore that row when you run it again?

So I'm new in python and I have just followed a tutorial to automate filling website forms with my customer data, but I have hundreds of rows of customer data that i need to fill on 3rd party websites and I need to dobule check the data before sending to the other website, so I need to track did python alreday input that row of user data to the website.

I want to mark the last cell of the row as done or true with boolean after running all the code and the script should only read the rows with the last cell that is Nan or false the next time i run it.

Is there anyway to achieve this or is there other better ways to solve this issue?

from selenium import webdriver
import pandas as pd
import time
import openpyxl
from selenium.webdriver.support.ui import Select

df = pd.read_excel('data.xlsx') # the excel file


driver = webdriver.Firefox() 
driver.get('example.com') 

time.sleep(2)

for i in df.index: #read the first row that are not marked as true or done in the last cell
    entry = df.loc[i]

    Ad = driver.find_element_by_id('street_address_1')
    Ad.send_keys(entry['Address'])

    city = driver.find_element_by_id('city')
    city.send_keys(entry['City'])

    select_state = Select(driver.find_element_by_name('state'))  
    select_state.select_by_value(entry['State'])

    zip = driver.find_element_by_id('zip_code') 
    integer_zip = entry["zipcode"] 
    string_zip = str(integer_zip) 
    zip.send_keys(string_zip)

    email_address= driver.find_element_by_id('email_address')
    email_address.send_keys(entry['email'])
    
    #mark last cell of row as done or True


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source