felipecsl/wombat

Dynamically set base_url and path.

Closed this issue · 2 comments

This is more of a question,

Would it be possible for to set base_url and path dynamically/run time?

No, this is not currently possible, sorry.

you can do it

     def crawl(path)
        raw_code = <<-CODE
           base_url "https://www.github.com"
           path "#{path}"

           headline xpath: "//h1"
           subheading css: "p.alt-lead"

           what_is({ css: ".one-fourth h4" }, :list)
        CODE

        block = ->(c) { eval(raw_code) }

        Wombat.crawl &block
     end