Filling in forms without using the macro function
fatboy
![]()
- Joined: Nov 17, 2009
- Posts: 4
Hey guys.
I am looking for a replacement for the current scripting software I am using and have grabbed the trial of WA3.
The main thing I want to do is visit a website, fill in a form and then save the resulting webpage.
The only thing I can see in the console is the download from web which grabs the web page fine, but where do I go from there?
Have looked in the KB but can't see anything along the lines I am after and there doesn't appear to be any decent documentation.
Please help guys :D
Thanks!
Jag Foo
![]()
- Joined: Jul 3, 2009
- Posts: 25
codex
![]()
- Joined: Nov 12, 2009
- Posts: 161
This is another interesting question. Since you were not very specific, my answer cannot be specific either (I will just provide you with some general information and some resources).
First of all, the feature that you are looking for is the "Download from Web" action. If I had to explain this action in 3 words I would probably say: "GUI-less Web Browser" (GUI stands for "Graphical User Interface"). This practically means that it can connect to any website using the HTTProtocol like a regular browser would do.
When you fill-in a form in a browser that has a graphical user interface, you are actually using one of the following 2 methods: GET or POST. However, a typical browser (Internet Explorer, Mozilla Firefox, Opera, Safari, Chrome) does not want you to see what happens in the background and what information it actually sends to the website through a form. For example, the user does not even know that there might be some hidden fields in a form.
The "Download from Web" action acts pretty much like every modern browser, allowing you to submit data using either the GET or the POST method. For more information regarding the differences of these 2 methods you can see a very detailed article here.
A command line tool that works like the "Download from Web" action is the cURL. This tool does pretty much the same stuff with "Download from Web"; however, the switches that you have to use with cURL are replaced by visual options inside WinAutomation (e.g. selection of the "User Agent", automatically follow redirection, clear cookies etc), or are being done implicitly (e.g. store cookies and use them in following "Download from Web" actions).
I could create a small tutorial about the steps that I follow whenever I want to automate a web page in the background with the "Download from Web" action. However, I will need some suggestions about possible websites that I could use in my demonstration. I already have some examples in mind but I would like to create the tutorial based on a website that is widely used.
fatboy
![]()
- Joined: Nov 17, 2009
- Posts: 4
Cheers guys - I was just practicing so was trying to use: http://www.w3schools.com/html/tryit.asp?filename=tryhtml_form_submit as a practoce platform.
codex
![]()
- Joined: Nov 12, 2009
- Posts: 161
The page that you linked is using the GET method (most forms are using the POST method). In the GET method, all arguments are passed to the web page through the URL. I have attached a sample job.
fatboy
![]()
- Joined: Nov 17, 2009
- Posts: 4
Well that has helped me no end - thanks buddy!!
Its so simple when someone sticks it in front of you, again thanks!
codex
![]()
- Joined: Nov 12, 2009
- Posts: 161
No problem matey! This was not so difficult since the GET method holds no secrets: everything is visible in the URL. However, with the POST method (which is actually the method that is used in most cases to fill in forms), you will probably need some more help. So, if you come across with a form that uses the POST method and can't figure out how to submit it, post here and I'll try to help you.