search

Home  >  Q&A  >  body text

ruby-on-rails - Ruby:Mechanize可以使用vpn代理访问网页吗?

请问,在Ruby下的Mechanize模块可以使用vpn代理访问网页吗?

怪我咯怪我咯2774 days ago805

reply all(1)I'll reply

  • ringa_lee

    ringa_lee2017-04-22 08:57:57

    Of course, you can also use a proxy
    http://mechanize.rubyforge.org/EXAMPLES_rdoc.html

    require 'rubygems'
    require 'mechanize'
    
    agent = Mechanize.new
    agent.set_proxy 'localhost', 8000
    page = agent.get(ARGV[0])
    puts page.body
    

    reply
    0
  • Cancelreply