sheet1 = client.open_by_url("https://docs.googlesheet")-- using google sheet here
sh = sheet1.worksheet("Sheet1")
dera = gd.get_as_dataframe(sh1,evaluate_formulas = True,skiprows = 0,has_header = True)
del = dera[['id']].dropna()
z = del2['names'].values.tolist()
driver.get("https://google.com/") -- using google.com as example
time.sleep(5)
driver.refresh()
time.sleep(2)
name_button = driver.find_element_by_xpath("//button[text()='NAMES']")
name_button.click()
time.sleep(2)
driver.find_element_by_xpath("//button[text()='Manual']")
time.sleep(2)
driver.find_element_by_xpath("//div[text()='Maximum 5000 Names']
/..//textarea").send_keys(z)
time.sleep(2)
Not able to pass the defined 430 rows of 'z' into send keys.
Could someone please help me with this.?
Changed the names of sheet and google chrome due to privacy issues.
pavelsaman
4,5581 gold badge15 silver badges37 bronze badges
1 Answer 1
You should try looping over the list you created. z is a list, and when you don't loop over the list it tries to run only once.
for value in z:
driver.find_element_by_xpath("//div[text()='Maximum 5000 Names']/..//textarea").send_keys(value)
time.sleep(2)
answered Oct 15, 2019 at 7:13
-
1Thanks for the response. I have converted the list to string. In order to pass the values to the send-keys. It's working now.beenuntz– beenuntz2019年10月18日 06:22:13 +00:00Commented Oct 18, 2019 at 6:22
default