python mechanize proxy support question

E

elca

Hello All

Happy New Year!

i have some question about python mechanize 's proxy support.

im making some web client script, and i would like to insert proxy support

function into my script.

for example ,if i have such like following some script.

how can i add proxy support into my mechanize script?

i was look for some reference , but not so much good hint from google.

params = urllib.urlencode({'id':id, 'passwd':pw})
rq = mechanize.Request("http://www.example.com" params)
rs = mechanize.urlopen(rq)

whenever i open this 'www.example.com' website , i would like open go
through proxy.

Thanks in advance!
 
A

alex23

that is only support mechanize.browser module.. actually
im looking mechanize.urlopen method.

From the docs:

In these examples, the workings are hidden inside the mechanize.urlopen
() function, which is an extension of urllib2.urlopen(). Redirects,
proxies and cookies are handled automatically by this function (note
that you may need a bit of configuration to get your proxies correctly
set up: see urllib2 documentation).

http://wwwsearch.sourceforge.net/mechanize/doc.html
 

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

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top