Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > General Coding
You last visited: Today at 02:58

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Python 3.5.1 urllib.request

Discussion on Python 3.5.1 urllib.request within the General Coding forum part of the Coders Den category.

Reply
 
Old   #1
 
lorddragon002's Avatar
 
elite*gold: 0
Join Date: Jan 2011
Posts: 332
Received Thanks: 95
Question Python 3.5.1 urllib.request

Hi,

i started experiment with python, and i stuck on sending POST request to website.
Is there anyone, who can help me?

I have this form on website, and i need to send "user" and "password".
I tried few ways, but i´m more confused than smart.

HTML Code:
<form action="index.php?action=login&show_server_selection=1" method="post" id="login_form" onsubmit="return Index.login_submit();">
		<div>
			<label for="user">
				<strong >User name:</strong>
				<span >
					<input id="user" name="user" class="text" type="text" value=""
						   onkeydown="if((e=window.event||event) && e.keyCode == 13 && $('#user').val() && $('#password').val()) $('#login_form').submit()"/>
				</span>
			</label>
			<label for="password">
				<strong >Password:</strong>
				<span >
					<input name="clear" type="hidden" value="true" />
					<input id="password" name="password" class="text" type="password"
						   onkeydown="if((e=window.event||event) && e.keyCode == 13 && $('#user').val() && $('#password').val()) $('#login_form').submit()"/>
				</span>
			</label>
			
			<input type="submit" id="login_submit_button" style="display: none" />

			<label for="cookie" class="remember_me">
				<input id="cookie" type="checkbox" name="cookie" value="true" checked="checked" />
					Remember me
			</label>

			<div id="login-buttons">
						
							
				<div id="js_login_button">
					<a href="#" onclick="$('#login_submit_button').click()" class="login_button">
						<span class="button_left"></span>
						<span class="button_middle">Login</span>
						<span class="button_right"></span>
					</a>
				</div>			
			</div>

			<br style="clear:both;"/>
		</div>
	</form>
Have a nice day guys.

Best regards,
lorddragon
lorddragon002 is offline  
Old 03/08/2016, 13:20   #2
 
MrDami123's Avatar
 
elite*gold: 56
Join Date: Oct 2010
Posts: 3,409
Received Thanks: 1,219
First check your whole post request with a browser.
Press F12 go to 'Network' and check which info your browser sends to the server. Replicate it in your script.
MrDami123 is offline  
Old 03/08/2016, 18:03   #3
 
lorddragon002's Avatar
 
elite*gold: 0
Join Date: Jan 2011
Posts: 332
Received Thanks: 95
Heh, finally i can move on.
Well, it works.
Thanks.


Now i have to set up cookies.

There is tons of tutorial with librery "httplib2", but it´s not working on version 3.5.1
Do u have some ideas?
lorddragon002 is offline  
Old 03/08/2016, 18:18   #4
 
MrDami123's Avatar
 
elite*gold: 56
Join Date: Oct 2010
Posts: 3,409
Received Thanks: 1,219
Always use .

edit:
Use 'requests.Session()' to auto-save cookies within the session.
MrDami123 is offline  
Thanks
1 User
Reply


Similar Threads Similar Threads
Urllib in python 2.7
07/31/2016 - Metin2 Private Server - 7 Replies
Hi. I have a 40k bin with python 2.7 and I have a problem with use Urllib in game, i import this lib, and when i run my bin i have something like that :confused: http://s3-eu-west-1.amazonaws.com/screenshooter-l egacy/rr-rpsordfsxdxxmhytblmg.jpg Can anyone tell my how to fix this?
Python urllib Botting
07/19/2015 - Coders Trading - 0 Replies
Hallo, ich biete hiermit meinen Botting Service an. Der Code wird mit Python programmiert und läuft somit mehr oder weniger überall. ICH mache keinen Browsergame Bot oder ähnliches. Bei starken Anti Bot Alghorithmen werde ich ein gegen Aufpreis diese Umgehen, wenn dies aber nicht möglich ist brech ich die Anfrage ab. Ihr erklärt euch durch kaufen meiner Botte dazu bereit das: -Wenn der Hersteller ein Anti Bot Mechanismus einbaut ((NACH DEM KAUF DES BOT'S)) (z.B Puzzle Captcha oder...
Python urllib geht nicht....
12/12/2013 - Metin2 Private Server - 0 Replies
Hallo Com, Ich wollte gerade in Python was schreiben das eine txt etc von nem webspace ausliest. Ich bekomme Folgenden Fehler: 1212 13:48:00257 :: url_request = urllib.urlopen("http://www.procoder.ch/python .txt").readline() 1212 13:48:00257 :: AttributeError 1212 13:48:00257 :: :
URLLIB einfügen
07/23/2013 - Metin2 Private Server - 8 Replies
Hallo liebe Community. Ich habe versucht nach dem Tutorial von CranK. Den Wartungsmodus im Client einzufügen. Es kommt aber der Error: Run - exceptions.ImportError: No module named urllib Nun die Frage. Wie füge ich URLLIB im Client ein? Am besten ein kleines Tutorial. Nutze den ic3 Client.
[Python]Urllib .txt auslesen
05/16/2013 - Metin2 Private Server - 7 Replies
Hey Ich hab ein kleines Problem und zwar wollte ich von einem Webspace gerne verschiedene Strings auslesen dann hab ich es zunächst mit einer normalen txt datei auf meinem pc probiert kein problem. Nur wenn ich das jetzt von dem Webspace auslesen kommt ein Error. Script: available = urllib.urlopen(url) availableList = available.read() availableFilter = str(availableList).replace("\n", "") availablePlayer = str(availableFilter).split(",") for i in...



All times are GMT +1. The time now is 02:58.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.