473,394 Members | 1,746 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 do initial login/password before can download web file with urllib?

I finally figured out how to use the wonderful module urllib to
download files.

What if web page requires you to fill out a form with login and
password first?

Is this just like any other FORM? Can login/password from a GET method
form be handled by appending something like "?login=foo,password=bar"
to URL?

Is that right way?

Chris

Jan 11 '06 #1
2 3497
se******@spawar.navy.mil wrote:
I finally figured out how to use the wonderful module urllib to
download files.

What if web page requires you to fill out a form with login and
password first?

Is this just like any other FORM? Can login/password from a GET method
form be handled by appending something like "?login=foo,password=bar"
to URL?

Is that right way?


If by "the URL" you mean the one that was used to retrieve the page in
the first place, then the answer is "not necessarily, and rarely".
Generally you need to parse the FORM and use its "action" attribute as
the URL, plus whatever form fields are required. It might be just login
and password, but the choice of names is form-specific and there may be
other (even hidden) fields that are required. Tools such as
http://wwwsearch.sourceforge.net/mechanize/ can help you with this.

-Peter

Jan 11 '06 #2
se******@spawar.navy.mil wrote:
I finally figured out how to use the wonderful module urllib to
download files.

What if web page requires you to fill out a form with login and
password first?


the examples section shows how to encode form data for either GET
or POST requests:

http://www.python.org/doc/current/lib/node483.html

(look at the page sources to see what the server wants you to use:
http://www.w3.org/TR/REC-html40/inte...html#h-17.13.1 )

</F>

Jan 11 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: EricP | last post by:
Hello, What are the default login/password to access pubs and northwind databases ? I remember the login = "sa", but nothing about the password. Thanks Eric
1
by: Larry | last post by:
Hi, my friends, As I know, service and start automatically even before user login. So If it's possible to create a service, make it running when system start , and record windows login password...
7
by: seberino | last post by:
How make a Python script 1. login 2. type password & 3. download file all from a **remote web site**? I'm not comfortable with *MY* software handling the password part.
7
by: FP | last post by:
I want to put some code at the top of my pages which will prompt the user for a name & password if the session variable IDUser is not set. How do I get the browser to display the login / password...
4
by: rony_16 | last post by:
Hi, I have a program that connects to a site With WebRequest and WebResponse . The response of this site is a file (csv file). The problem is that the file do not comes as a stream , hi is a part...
2
by: jdstroud | last post by:
I have an asp.net application on our intranet, and I am trying to use windows authentication. My problem is that I would like to get the user's credentials without having the login / password...
10
by: Arkwell | last post by:
If I am logged on to the admin account but don't know the password, is there any way I can have windows display the current login password on the screen? Maybe using command prompt?
0
by: buntybutt | last post by:
Some how I forgot my Apple IBook G4 Login password, and now I am stuck there and don't know how to login. Is there any way which i can use to remove it.
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
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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.