I Want To Fill The data in input
i have 250 records in my sheet
i want to fill country with currency and code and click on submit and then second country currency and code then third
But The Problem is When i try to run my this code:
It's Not Changing Country And Currency for example if i had two countries Afghanistan and Albania
my script want to write Afghanistan first time and hit submit and the next time it want to write Albania
but it's only typing Afghanistan again and again!
Here is the Video So You Guys Can Understand Better!
Here is my code:
from selenium import webdriver
import pandas as pd
count = pd.read_csv('c.csv')
list_of_c = count['COUNTRY'].to_list()
cur = pd.read_csv('cur.csv')
list_of_cur = cur['CUR'].to_list()
co = pd.read_csv('code.csv')
list_of_code = co['CODE'].to_list()
def code():
driver = webdriver.Chrome()
driver.get('http://lachisolutions.com/bitcoinerrs/countries.php')
for code in list_of_code:
for countrys in list_of_c:
for curs in list_of_cur:
country = driver.find_element_by_css_selector('.text-center+ .form-group .form-control').send_keys(str(countrys))
currency = driver.find_element_by_css_selector('.form-group:nth-child(3) .form-control').send_keys(str(curs))
code = driver.find_element_by_css_selector('.form-group~ .form-group+ .form-group .form-control').send_keys(str(code))
button = driver.find_element_by_css_selector('.btn-block').click()
code()
c.csv
COUNTRY
Afghanistan
Albania
Algeria
American Samoa
Andorra
Angola
Anguilla
Antigua and Barbuda
Argentina
It's Only Writing Currency in right way

forloop of the country is outside theforloop of currency, so it will iterate over all the currencies for one country, then change the country and iterate over all the currencies, and so on. Just revise the concept of nestedforloop once.