Home > Net >  Automating Web form Filling using Selenium or Mechanize Python with Pandas Dataframe
Automating Web form Filling using Selenium or Mechanize Python with Pandas Dataframe

Time:08-06

Automating Web form Filling using Selenium or Mechanize Python with Pandas Dataframe.

I am looping through a three columns of pandas dataframe to auto-complete the form for me and submit. Below is the code I came up with. Should I use Selenium or Mechanize and how?

I have a dataframe called checkdatframe with 1010 entries the columns are:

checkdataframe['CODENUM']

checkdataframe['NAME']

checkdataframe['EMAIL']

checkdataframe['ITEM']

import pandas as pd
import numpy as np
for row in checkdataframe.CODENUM:
    if row in '105701':
       url = "https://www.searchitemscompany.com/lookupitems.do?from=Home&locale=en_US"
       br.open(url)
           for column in checkdataframe[['NAME', 'EMAIL','ITEM']]:
               br.select_form('form[action="/lookupitems.do?from=Home&locale=en_US"]')
               br.form['username'] = 
               br.form['emailaddress'] = 
               br.form['product'] = 
        

CodePudding user response:

Convert the information into a csv and then run the program

  • Related