Class: Ronin::Web::Mechanize
- Inherits:
-
Mechanize
- Object
- Mechanize
- Ronin::Web::Mechanize
- Defined in:
- lib/ronin/web/mechanize.rb
Overview
Convenience class based on Mechanize.
Instance Method Summary collapse
-
#initialize(proxy: Support::Network::HTTP.proxy, user_agent: Support::Network::HTTP.user_agent) {|agent| ... } ⇒ Mechanize
constructor
Creates a new [Mechanize] Agent.
Constructor Details
#initialize(proxy: Support::Network::HTTP.proxy, user_agent: Support::Network::HTTP.user_agent) {|agent| ... } ⇒ Mechanize
Creates a new Mechanize Agent.
The User-Agent
string to use.
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 |
# File 'lib/ronin/web/mechanize.rb', line 58 def initialize(proxy: Support::Network::HTTP.proxy, user_agent: Support::Network::HTTP.user_agent) super() self.verify_mode = OpenSSL::SSL::VERIFY_NONE if proxy proxy = URI(proxy) set_proxy(proxy.host,proxy.port,proxy.user,proxy.password) end if user_agent self.user_agent = case user_agent when Symbol Support::Network::HTTP::UserAgents[user_agent] else user_agent end end yield self if block_given? end |