473,394 Members | 1,852 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

How can to post the username and password to a website?

Hi, now i used Python 2.5 for coding the scripts to access to a website. I try to use the urllib2. But i don't know how to post the user name and the password to the login form. So, please show me how must i do?

Thanks,
Oct 13 '07 #1
2 1908
bartonc
6,596 Expert 4TB
Hi, now i used Python 2.5 for coding the scripts to access to a website. I try to use the urllib2. But i don't know how to post the user name and the password to the login form. So, please show me how must i do?

Thanks,
This section of the documentation looks promising:
URLopener and FancyURLopener objects have the following attributes.

prompt_user_passwd( host, realm)

Return information needed to authenticate the user at the given host in the specified security realm. The return value should be a tuple, (user, password), which can be used for basic authentication.
The implementation prompts for this information on the terminal; an application should override this method to use an appropriate interaction model in the local environment.
Oct 13 '07 #2
This section of the documentation looks promising:
thanks so much, but can u show me a ex. code to login to a website by post method.

Please,
Oct 13 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Candice | last post by:
Please somebody help! I've deleted my admin username and password which was initially set at test. Now I can't log into my website as the administrator. How do I put Username and Password back so...
1
by: Manuel | last post by:
I have to log into a website and retrieve some information. The problem is that the post isn't "normal". I'm used to passing post values in the form of: Variable1=Value1&Variable2=Value2 etc. I...
0
by: WIWA | last post by:
Hi, I want to login to a password protected website and fetch the content of the page behind. I have based my code on http://weblogs.asp.net/jdennany/archive/2005/04/23/403971.aspx. When I use...
5
by: Tyler | last post by:
I am developing an application which will allow me to automatically sign into an external website. I can currently do a screen scrape using HTTPWEBREQUEST. However I want to just redirect to the...
0
by: barrybevel | last post by:
Hi, I'm trying to login to the www.vodafone.ie website using HttpWebRequest. It works fine with IE/Firefox and the .NET Web Control too, just not with my code. I think it's a redirect 302...
3
by: Co | last post by:
Hi All, I use a website in asp for which I have to type a username and password everytime I want to login. On the form are two fields for typing the username and password and one button LOGIN....
1
by: micksitup | last post by:
hi all. I have 3 files:- Pick_moduser.php do_moduser.php show_moduser.php problem is it just doesnt want to pass anything through
7
by: Dhiru1009 | last post by:
Hi guys, I need help with validating the user to see if the username exists in database table or not. Here is my code. default.php <form name="form1" action="authenticate.php">
6
by: rpcchandu | last post by:
Hi Coders, I have to redirect from my server to the different server page by simulating the POST method submit from the Controller file, I tried using post_via_redirect, but could not succeed......
12
by: AdamOnAccess | last post by:
I have a form with a combo box called "cmbWebsites". The combo box row source comes from a select query that returns rows: 0.WebsiteID 1.Website Name 2.Website URL 3.Username 4.Password
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.