Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Python 

How to properly submit form data?

got it figured out thanks
(Sep 19, 2017 03:53 PM)Tyrannus Wrote:  I've been studying a bit of python lately, and i've been looking into submitting form data with urllib but I can't seem to figure this one out. I'm trying to create an account generator for this website:
Can somebody help me with this?


okay so this is what I have so far, can anyone help?

pastebin. com/pT4pSj7d

try using the requests module, much easier.
PHP Code

<?php 
import requests
mail 
= "testacc"+str(random.randint(1111,99999))+"@gmail.com"
usr = "ffffff22"
pwd = "ffff111"

values = {
    
"birthDate" : 25,
    
"userName" : usr,
    
"password" : pwd,
    
"passwordAgain" : pwd,
    
"email" : mail,
    
"emailAgain" : mail
}

r = requests.post("https://www.wizard101.com/user/registration", values)
print(
r.text) -- responce 

haven't tested it, if you see an error and fix it and it still doesn't work try using the request headers and do
Code
r = requests.post("https://www.wizard101.com/user/registration", data=values, headers=headers)
headers is a dict
i like python lua js


Possibly Related Threads...
Thread / Author Replies Views Last Post
[C#] by Andersen.Jun 24, 2017 09:28 AM 1 112 Jun 24, 2017 09:28 AM
Last Post: TCP
[C] by Andersen.Jun 24, 2017 08:42 AM 0 87 Jun 24, 2017 08:42 AM
Last Post: Andersen.
[C#] by DarkETHOSMar 30, 2016 12:49 PM 6 210 Mar 30, 2016 12:49 PM
Last Post: Zilog80