Python does not allow a variable named "pass"

B

BJ Swope

I am trying to automate access to a web page that has forms based
authentication. The password field is named "pass" which python is
not going to like.

Other than asking the website owner to change the name of the field
how can I go about passing that field in the form post?

dev:~$ python
Python 2.5.2 (r252:60911, Jan 24 2010, 14:53:14)
[GCC 4.3.2] on linux2
Type "help", "copyright", "credits" or "license" for more information. File "<stdin>", line 1
params = urllib.urlencode(dict(pass='foo'))
^
SyntaxError: invalid syntax
 
G

Giampaolo Rodola'

I am trying to automate access to a web page that has forms based
authentication.  The password field is named "pass" which python is
not going to like.

Other than asking the website owner to change the name of the field
how can I go about passing that field in the form post?

dev:~$ python
Python 2.5.2 (r252:60911, Jan 24 2010, 14:53:14)
[GCC 4.3.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.>>> import urllib
  File "<stdin>", line 1
    params = urllib.urlencode(dict(pass='foo'))
                                      ^
SyntaxError: invalid syntax


--- Giampaolo
http://code.google.com/p/pyftpdlib
http://code.google.com/p/psutil
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top