Visual Web Ripper Logo Visual Web Ripper Logo

Highlighted features

How to submit a form with a list of input values?

added: 3/1/2010 Version: 2.33.5

In this article I'll explain how to submit a form for each value in a simple list or in a CSV input file.

I have a list of US zip codes and I want to submit these values to the website http://zip4.usps.com/zip4/citytown_zip.jsp and extract matching cities.

First I create the project as if I only had one zip value. This is a very simple task:

1. I add a FormField element for the zip input field and enter a zip code in the Capture window (when you want to assign a value to a FormField element you can enter the value in the Capture window).

2. I add a FormSubmit template for the submit button.

3. I open the FormSubmit template and add a content element to extract the matching city.

If I want Visual Web Ripper to submit the form for a list of values, I can simply edit the zip FormField element and enter the list of value in the Capture window.

If I want Visual Web Ripper to read the input values from a CSV file (or a database table), I need to define an input data source and assign a data column to the zip FormField element. I do this by following these steps:

1. I create a CSV file with all the input values. Notice the CSV file must have a header row as shown below:

2. I copy the CSV file to the default Visual Web Ripper project folder. This is the default location for input files, but you can place the file anywhere you like.

3. I click the "Input Data Source" toolbar button, and select CSV as input format. Then I select the CSV file I just created.

4. I can view the input values by clicking the "View Data" button. Here I can also select the value I want to use when designing the project (Visual Web Ripper will use the first value by default).

5. I now edit the zip FormField content element and click the Database options tab. Here I choose the Input Data Source option and select the zip data column.

Visual Web Ripper will now read the zip codes from the CSV file and submit the form once for each zip code value.

Download demo project and data extract Usps.zip

Comments

  Required Field - required field
Comment Required Field
Attachement
Loading...
Add
  • Very user friendly visual project designer.
  • Extract complete data structures, such as product catalogues.
  • Repeatedly submit forms for all possible input values.
  • Extract data from highly dynamic web sites including AJAX web sites.
  • Web data extraction scheduler with email notifications and logging.
  • Custom post-processing and comprehensive API.
  • Only $299 including 1 year maintenance.

© 2009-2010 Sequentum  |  Terms & Conditions  |  Privacy Statement  |  Login