felipecsl / wombat

Lightweight Ruby web crawler/scraper with an elegant DSL which extracts structured data from pages.
https://felipecsl.github.io/wombat/
MIT License
1.31k stars 129 forks source link

`set_proxy` not working #66

Closed bachand closed 7 years ago

bachand commented 7 years ago

I tried out a slightly modified version of the example provided:

require 'wombat'

class HeadersScraper
  include Wombat::Crawler

  base_url "http://www.rubygems.org"
  path "/"

  set_proxy("localhost", 8888)
end

I get this error:

/Users/michael/.rvm/gems/ruby-2.3.1/gems/wombat-2.5.1/lib/wombat/property/locators/factory.rb:34:in `locator_for': Unknown property format 8888. (Wombat::Property::Locators::UnknownTypeException)

Here's my setup:

Moving this to the configure block is a workaround:

Wombat.configure do |config|
  config.set_proxy("localhost", 8888)
end
felipecsl commented 7 years ago

Hi there @bachand 😄 I've updated the wiki doc to reflect this. It was indeed wrong. Thanks!