Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Programmatically log in and request XML

Thread Tools

Programmatically log in and request XML

Tim Johnson
Posts: n/a
FYI: Using python 2.7 on ubuntu 10.04.

I have acquainted myself with the parsing of XML data using an input file as
test data. Now I need to make a request the feed itself, and capture
that field as data.

I need to do the following:
1)Programmatically log into a site with user and password.
2)Make a GET request to a site under the same domain.

Since I have used urllib2 in the past,

I am offering a modification of the example under the heading:
Use of Basic HTTP Authentication
import urllib2
# Create an OpenerDirector with support for Basic HTTP Authentication...
auth_handler = urllib2.HTTPBasicAuthHandler()
opener = urllib2.build_opener(auth_handler)
# ...and install it globally so it can be used with urlopen.

Am I at the correct starting point?
If so, I can take it from there
If not,
Can someone recommend a better approach?

tim at johnsons-web dot com or akwebsoft dot com
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
On my web site need the capability to log in as administrator and for others to log in anonymously AAaron123 ASP .Net 1 10-14-2008 08:14 PM
Different results parsing a XML file with XML::Simple (XML::Sax vs. XML::Parser) Erik Wasser Perl Misc 5 03-05-2006 10:09 PM
Programmatically turn off custom errors for current request Matt ASP .Net 2 06-30-2004 04:06 PM
Programmatically Generate a POST to Log Into Site and Screen Scrape Tony Pino ASP .Net 5 12-03-2003 09:18 PM
Re: Accessing Request.InputStream / Request.BinaryRead *as the request is occuring*: How??? Brian Birtle ASP .Net 2 10-16-2003 02:11 PM