PDA

View Full Version : Constructing the URL for a Form


kenlyle
11th August 2006, 01:17 AM
I want to collect data from a page where there is a pulldown to select a U.S. state, then a results page is returned, and I want to mine the results page.

The <form> code is:

<form method="post" action="search.php">
<input type="hidden" name="searchtype" value="state">
Browse by Country/State


<select size="1" name="state">
<option value="">US AND INTERNATIONAL LOCATIONS</option>
<option value="">--US LOCATIONS--</option>
<option value="Alabama">Alabama</option>
<option value="Alaska">Alaska</option>
<option value="Arizona">Arizona</option>
<option value="Arkansas">Arkansas</option>
<option value="California">California</option>
...etc...

What's the form of the URL to start with, and how do I loop through the states?

Thanks,
Ken

vzeman
11th August 2006, 07:03 AM
Do you like to execute request for each state ?
Or do you like to collect all states for later evaluation ?

kenlyle
11th August 2006, 01:56 PM
Good question.

Execute the request/query/URL for each state/option in the Select list, and mine the results pages, all to the same output file.

Thanks,
Ken

vzeman
15th August 2006, 07:03 AM
Hi.

I would do it in following order on your place:

1. I would grab list of all states (section while and pattern tags) into array

2. I would grab all actions (section while and pattern tag) into array


3. I will iterate with section foreach in all states and deeper with section foreach in all actions and inside these 2 foreach sections I will execute url request + any other code, which you like to do.


If you like, we can write such script for you completelly, but this will be payed service.