472,372 Members | 1,467 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

using httplib for authentication

Hello All,

I want to use python to download files from sites where authentication is
required. The page appears to send a form with the login and pass by post. I
would like to log in and keep this session open within python and
download a number of files automatically. Could anyone kindly point me in the
right direction? I have discovered httplib and read the documentation and
looked at the examples, but they don't seem helpful for this.

James

--
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095

http://www.jamesstroud.com/
Aug 3 '05 #1
2 2528

James Stroud wrote:
Hello All,

I want to use python to download files from sites where authentication is
required. The page appears to send a form with the login and pass by post. I
would like to log in and keep this session open within python and
download a number of files automatically. Could anyone kindly point me in the
right direction? I have discovered httplib and read the documentation and
looked at the examples, but they don't seem helpful for this.

Hello James,

httplib is built on top of the socket module - but is still a library
meant for doing fairly low level http operations. For fetching URLs,
urllib2 is probably the way to go. It handles GET and POST with ease.

If you think this will do the job then you could try reading the
urllib2 tutorial at :

http://www.voidspace.org.uk/python/articles.shtml#http

You might wnat to look at other extension modules too - ClientCookie
for handling cookies, ClientForm for automatically filling in the
forms, BeautifulSoup for parsing HTML pages....

All the Best,

Fuzzy
http://www.voidspace.org.uk/python
James

--
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095

http://www.jamesstroud.com/


Aug 3 '05 #2
Thank you Fuzzy, I will look into these things. Maybe the site is setting a
cookie, as you have suggested. I have never delved into the ways of http
except to configure apache and write some very bare-bones web pages, so I
have to say that some very obvious things do not occur to me.

James

On Wednesday 03 August 2005 08:41 am, Fuzzyman wrote:
Hello James,

httplib is built on top of the socket module - but is still a library
meant for doing fairly low level http operations. For fetching URLs,
urllib2 is probably the way to go. It handles GET and POST with ease.

If you think this will do the job then you could try reading the
urllib2 tutorial at :

http://www.voidspace.org.uk/python/articles.shtml#http

You might wnat to look at other extension modules too - ClientCookie
for handling cookies, ClientForm for automatically filling in the
forms, BeautifulSoup for parsing HTML pages....

All the Best,

Fuzzy
http://www.voidspace.org.uk/python

Aug 3 '05 #3

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

Similar topics

7
by: luigipaioro | last post by:
Good morning to all! I'm trying to access on a web page that needs user and password authentication. I'm enabled to access there (I mean that I have an user name and a password to access via...
4
by: Roger Binns | last post by:
I have just spent several weeks mashing xmlrpc, httplib and SSL (from M2Crypto) to work together. The current standard library has several problems: - Builtin SSL is pretty much useless if you...
1
by: Brian Beck | last post by:
Hi. I'm having some problems with code based directly on the following httplib documentation code: http://www.zvon.org/other/python/doc21/lib/httplib-examples.html I've included the code and...
0
by: Leon | last post by:
I use sniffer look,it's status is 200,but run getresponse() can occur error ResponseNotReady I try wait it by 5 seconds,but still occur error ResponseNotReady source code.... import...
3
by: John Reese | last post by:
Hello there. I've run into some missing functionality with HTTP Digest authentication in the 2.3 library and I was wondering if I'm just missing something. Missing functionality the first:...
0
by: Pieter Edelman | last post by:
Hi all, I'm trying to submit some data using a POST request to a HTTP server with BASIC authentication with python, but I can't get it to work. Since it's driving me completely nuts, so here's...
0
by: Robert | last post by:
did you solve this problem? It seems to be still present here with py2.3.5. Robert -- From: Manish Jethani <manish.j@gmx.net> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US;...
1
by: Michele Simionato | last post by:
Can somebody provide an example of how to retrieve a https url, given username and password? I don't find it in the standard documentation. TIA, Michele Simionato
0
by: emiliano | last post by:
Hey guys, i was just googling some information about how to use the ClientForm package with a page which requires HTTP basic authentication and i got here :P ... So here is the problem, lets see if...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
2
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...
1
by: Johno34 | last post by:
I have this click event on my form. It speaks to a Datasheet Subform Private Sub Command260_Click() Dim r As DAO.Recordset Set r = Form_frmABCD.Form.RecordsetClone r.MoveFirst Do If...
1
by: ezappsrUS | last post by:
Hi, I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...
0
by: jack2019x | last post by:
hello, Is there code or static lib for hook swapchain present? I wanna hook dxgi swapchain present for dx11 and dx9.

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.