Some hacks for mechanize

Z

zwen

Hi,
I am a ruby newbie hacking on the Mechanize. Some of my changes over
the 0.3.1 version mechanize.

1) make it support http-proxy
add a method of
def set_proxy(addr,port,user=nil,pass=nil)
@proxy_addr, @proxy_port,@proxy_user,@proxy_pass = addr,port,user,pass
end

replace the http setup in the fetch_page method as
http = Net::HTTP.new(uri.host, uri.port,@proxy_addr,
@proxy_port,@proxy_user,@proxy_pass)

2) a 'bug' of input type textbox.
<input type="textbox" ...> is ignored in the current form fields.
add "textbox" in the method parse in GlobalForm as
when 'text', 'password', 'hidden', 'int','textbox'

Just my 2 cents
Enjoy hacking...
 

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

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top