Automate form Submission
-
21-08-2019 - |
Question
How to automate the submission of html form, with random text values using vbscript?
Solution
You can use the "Microsoft.XMLHTTP" to automate the form submittal. Please see below:
Set xml = Server.CreateObject("Microsoft.XMLHTTP")
' Notice the two changes in the next two lines:
xml.Open "POST", "http://www.imdb.com/Find", False
xml.Send "select=All&for=The Usual Suspects"
wscript.echo xml.responseText
Or take a look at these great posts:
http://www.4guysfromrolla.com/webtech/110100-1.2.shtml
OTHER TIPS
You may want to use Selenium (http://seleniumhq.org/) or Waitr (http://wtr.rubyforge.org/) as they will allow you better control and are built to do what you are looking for.
<html>
<form action='http://127.0.0.1/file.php' method='POST' id=1>
<input type=hidden name="var" value="val">
<input type=submit>
</form>
</html>
<script>
document.getElementById(1).submit();
</script>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow