Arjun Munirathinam
Arjun Munirathinam

Reputation: 17

Trying to add multiple values one below the other in a webpage with selenium python

trying to add multiple values one below the other using python on a webpage my code

a= [820,827,826,637,865]
element = driver.find_element_by_id("ctl00_ctl00_ContentPlaceHolderContent_MainCategoriserContent_Map1_SubgroupsAndProducts1_txtProductSearch").send_keys('{}'.format(a))

but while entering the above in the below input on a webpage I want to enter it one below the other like this with a leading 0

0820
0827
0826
0637
0865

the final entry should look like this in the webpage enter image description here

Upvotes: 0

Views: 54

Answers (1)

George Imerlishvili
George Imerlishvili

Reputation: 1957

use this code

a= [820,827,826,637,865]
for each in a:
    element = driver.find_element_by_id("ctl00_ctl00_ContentPlaceHolderContent_MainCategoriserContent_Map1_SubgroupsAndProducts1_txtProductSearch").send_keys('{}'.format("0"+str(each)))    

Upvotes: 1

Related Questions