Github 链接:-
https://github.com/jarib/browsermob-proxy-rb
我正在使用 browsermob 代理创建代理,方法如下:-
require 'selenium/webdriver'
require 'browsermob/proxy'
server = BrowserMob::Proxy::Server.new("/path/to/downloads/browsermob-proxy/bin/browsermob-proxy") #=> #<BrowserMob::Proxy::Server:0x000001022c6ea8 ...>
server.start
在执行“server.start”时,它会抛出如下错误:-
Error: Could not find or load main class net.lightbody.bmp.proxy.Main
BrowserMob::Proxy::Server::ServerDiedError: unable to launch the server (rerun with :log => true to see process output)
from /home/ubuntu/.rvm/gems/ruby-2.2.0@v-qa/gems/browsermob-proxy-0.2.0/lib/browsermob/proxy/server.rb:75:in `wait_for_startup'
from /home/ubuntu/.rvm/gems/ruby-2.2.0@v-qa/gems/browsermob-proxy-0.2.0/lib/browsermob/proxy/server.rb:34:in `start'
from (irb):13
from /home/ubuntu/.rvm/rubies/ruby-2.2.0/bin/irb:11:in `<main>'
我该如何解决这个问题?