Automatiser forme de soumission
-
21-08-2019 - |
Question
Comment automatiser la soumission du formulaire HTML, avec des valeurs de texte aléatoire en utilisant vbscript?
La solution
Vous pouvez utiliser le « Microsoft.XMLHTTP » pour automatiser le formulaire de soumission. S'il vous plaît voir ci-dessous:
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
Ou jeter un oeil à ces grands messages:
http://www.4guysfromrolla.com/webtech/110100-1.2.shtml
Autres conseils
Vous pouvez utiliser Sélénium ( http://seleniumhq.org/ ) ou Waitr ( http://wtr.rubyforge.org/ ) car ils vous permettront un meilleur contrôle et sont conçus pour faire ce que vous cherchez pour.
<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>
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow