Viot Camille
Viot Camille

Reputation: 197

Auto-Filling Web Form by an HTML/PHP/JS page

I have a very simple issue and I'm looking for a simple way to do that. In fact, I'm searching to auto-fill a Web-Form from an official webPage of an institution and I would like to do it in Javascript into a webpage which will do it automatically on client-side.

I tried CasperJS/PhantomJS which is very useful to do that but they have to be run by command line and not by a js script.

This webForm is very simple.It has several dropdownList, checkboxes and text input with a simple submit button.

I don't need some detailed code but just the way/tools to achieve that. I'm on it since 2 weeks without any good results.

Upvotes: 0

Views: 1803

Answers (2)

Debasis Mondal
Debasis Mondal

Reputation: 65

The best way to do that is using Selenium. Use Selenium and you can easily fill out forms of third party.

Upvotes: 0

Digital Chris
Digital Chris

Reputation: 6202

Ideally, this should be done server to server. What you want is a web service. This way you don't have to have a client machine with a browser sitting open to handle this.

A quicker and dirtier method would be to submit the form data directly to the 3rd party web server via cURL:

https://superuser.com/questions/149329/what-is-the-curl-command-line-syntax-to-do-a-post-request

http://curl.haxx.se/docs/httpscripting.html

Upvotes: 1

Related Questions