470,636 Members | 1,655 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,636 developers. It's quick & easy.

Access Database Using Python

I'm writing a script to look through DNA sequences in a database and
select sequences I require. So far, my code looks like this for
authentication:

import os
import Bio.Clustalw
from Bio.Alphabet import IUPAC
import pdb
import sys
import os
import urllib
import urllib2
import urllib
userid = 'kmdawg'
password = 'kmdawgyeah'
location = 'index.html'
params = urllib.urlencode({'user': userid, 'password': password,
'request_uri': location})
f = urllib2.urlopen("http://www.gene-regulation.com/login?%s" % params)
print f.read()

When I run the program, I see the following:
______________

<HTML>
<HEAD>
<TITLE>Redirect</TITLE>
<META http-equiv="pragma" content="no-cache">
<META http-equiv="cache-control" content="no-cache">
<META http-equiv="expires" content="0">
<META http-equiv="refresh" content="1; URL=index.html"></HEAD><BODY
bgcolor="white">
<h1>Please stand by, you will be redirected
toindex.html...</h1></body></html>
________________

The code works as it is. How would I modify this script to display the
page
"http://www.gene-regulation.com/cgi-bin/pub/databases/transfac/getTF.cgi?AC=R00077"?
I can't figure out how to authenticate and then load a page, since the
page requires cookies for authentication.

Thanks.

Jul 19 '05 #1
0 916

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

10 posts views Thread by David ROBERT | last post: by
1 post views Thread by Uggen Kristin T | last post: by
reply views Thread by asdf sdf | last post: by
4 posts views Thread by Edward Diener | last post: by
1 post views Thread by DD | last post: by
49 posts views Thread by Yannick Turgeon | last post: by
2 posts views Thread by infotechsys | last post: by
3 posts views Thread by Rajendran | last post: by
1 post views Thread by bg_ie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.