my python script wont to set the name and the age on the html form which has a POST method is it possible to handle with html forms in python HTML Script:
<html>
<form action="action.php" method="post">
<p>Votre Nom : <input type="text" name="nom" /></p>
<p>Votre Age : <input type="text" name="age" /></p>
<p><input type="submit" value="OK"></p>
</form>
</html>
PYTHON script :
import urllib.request, urllib.parse, socket
data = urllib.parse.urlencode({"nom":"joe", "age":"17"}).encode('utf-8')
req = urllib.request.Request("http://127.0.0.1/index.html", data=data)
res = urllib.request.urlopen(req).read().decode()
after runing the script in the terminal all what i get is the same html code