Module: Wombat

Defined in:
lib/wombat.rb,
lib/wombat/crawler.rb,
lib/wombat/dsl/headers.rb,
lib/wombat/dsl/follower.rb,
lib/wombat/dsl/iterator.rb,
lib/wombat/dsl/metadata.rb,
lib/wombat/dsl/property.rb,
lib/wombat/processing/parser.rb,
lib/wombat/dsl/property_group.rb,
lib/wombat/property/locators/base.rb,
lib/wombat/property/locators/html.rb,
lib/wombat/property/locators/list.rb,
lib/wombat/property/locators/text.rb,
lib/wombat/processing/node_selector.rb,
lib/wombat/property/locators/follow.rb,
lib/wombat/property/locators/factory.rb,
lib/wombat/property/locators/headers.rb,
lib/wombat/property/locators/iterator.rb,
lib/wombat/property/locators/property_group.rb

Defined Under Namespace

Modules: Crawler, DSL, Processing, Property

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.proxy_argsObject (readonly)

Returns the value of attribute proxy_args.



8
9
10
# File 'lib/wombat.rb', line 8

def proxy_args
  @proxy_args
end

.user_agentObject (readonly)

Returns the value of attribute user_agent.



8
9
10
# File 'lib/wombat.rb', line 8

def user_agent
  @user_agent
end

.user_agent_aliasObject (readonly)

Returns the value of attribute user_agent_alias.



8
9
10
# File 'lib/wombat.rb', line 8

def user_agent_alias
  @user_agent_alias
end

Class Method Details

.configure {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:

  • _self (Wombat)

    the object that the method was called on



16
17
18
# File 'lib/wombat.rb', line 16

def configure
  yield self
end

.crawl(&block) ⇒ Object Also known as: scrape



10
11
12
13
14
# File 'lib/wombat.rb', line 10

def crawl(&block)
  klass = Class.new
  klass.send(:include, Wombat::Crawler)
  klass.new.crawl(&block)
end

.set_proxy(*args) ⇒ Object



20
21
22
# File 'lib/wombat.rb', line 20

def set_proxy(*args)
  @proxy_args = args
end

.set_user_agent(user_agent) ⇒ Object



24
25
26
# File 'lib/wombat.rb', line 24

def set_user_agent(user_agent)
  @user_agent = user_agent
end

.set_user_agent_alias(user_agent_alias) ⇒ Object



28
29
30
# File 'lib/wombat.rb', line 28

def set_user_agent_alias(user_agent_alias)
  @user_agent_alias = user_agent_alias
end