Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Posting value from excel to Form (Python+Selenium)
#1
import selenium
import time
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.common.exceptions import NoSuchElementException
pass_email = df['Email'].tolist()
type(pass_email)

#using chrome to access web
driver = webdriver.Chrome("path\\chromedriver.exe")
#open the specific page 
driver.get("url")
#find the fields where the value needs to be entered
for value in pass_email:
    try:
        text_input = driver.find_element_by_xpath("//input[contains(@id, 'f_f2ce5e85a5f51997dfcb1f8e645a3c2d')]")
        text_input.clear()
        text_input.send_keys(value)
        time.sleep(2)
        sub_btn = driver.find_element_by_xpath("//input[contains(@id, 'btnSubmit')]")
        sub_btn.click()
        time.sleep(2)
    except NoSuchElementException:
            continue



I have tried above code to pull the values from list and post it in a form and submit. However, it's getting stopped after first iteration.

Thank you in advance.
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  Posting html values to views/models in Django Malt 1 277 Sep-04-2019, 01:44 PM
Last Post: fishhook
  Python - Scrapy Login form Baggelhsk95 4 4,343 Oct-16-2018, 08:01 AM
Last Post: Baggelhsk95
  Edit Form using Selenium Prince_Bhatia 2 1,478 Feb-14-2018, 10:31 PM
Last Post: snippsat
  Python....excel....html form tarliver 2 4,081 Dec-20-2017, 07:02 AM
Last Post: buran
  Error in Selenium: CRITICAL:root:Selenium module is not installed...Exiting program. AcszE 1 1,158 Nov-03-2017, 08:41 PM
Last Post: metulburr
  Selenium to pick data from excel and enter into backend Prince_Bhatia 0 1,392 Aug-30-2017, 10:32 AM
Last Post: Prince_Bhatia

Forum Jump:


Users browsing this thread: 1 Guest(s)