Creating a "robot" to fill out a form with several pages in

I want to implement a "robot" that could automatically fill out forms. Is there a solution when you can fill in the data on the page, for example, form1.html and send it, wait until the next page and send with the data form2.html and so on ... At the end it should also 'click' on the button to Get the file that the form creates.

I want this "robot" to use some confidential information, so it cannot be used using client side technologies.

I was thinking about PHP - creating it as a website web service, so you could transfer data to a web address or web service in .Net .

If this is important, the site that I want to populate automatically starts with ASP.NET .

I'm kind of new here ... Can anyone give examples or tutorials that do this. If there were some technologies that I did not mention here to understand this, I would be happy to try them as well.

+8
source share
3 answers

Working with forms by sending data, so instead of creating a robot that enters something into each field and presses the "Submit" button, you can simply POST data to the server.

First, take the field names of the form and the action form.

Then CURL:

 //set POST variables $url = 'http://domain.com/get-post.php'; $fields = array( 'lname' => urlencode($last_name), 'fname' => urlencode($first_name), 'title' => urlencode($title), 'company' => urlencode($institution), 'age' => urlencode($age), 'email' => urlencode($email), 'phone' => urlencode($phone) ); //url-ify the data for the POST foreach($fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; } rtrim($fields_string, '&'); //open connection $ch = curl_init(); //set the url, number of POST vars, POST data curl_setopt($ch,CURLOPT_URL, $url); curl_setopt($ch,CURLOPT_POST, count($fields)); curl_setopt($ch,CURLOPT_POSTFIELDS, $fields_string); //execute post $result = curl_exec($ch); //close connection curl_close($ch); 

A snapshot from this site .

+9
source

Use Selenium .

"Selenium automates browsers, what you do with this power is completely up to you. First of all, it concerns the automation of web applications for testing purposes, but, of course, is not limited to this. (And should!) Also be automated. "

See examples here .

enter image description here

+9
source

Did you manage to create something to automatically fill out the online form and submit?

0
source

All Articles