Browser: driver mechanize has been destroyed code example
Example: Browser: driver mechanize has been destroyed
# example_spider.rb
require 'kimurai'
require 'net/http'
class ExampleSpider < Kimurai::Base
@name = "example_spider"
@engine = :mechanize
@start_urls = ["https://www.videos.com/test"]
@config = {
skip_request_errors: [
{ error: RuntimeError, message: "404 => Net::HTTPNotFound" }
]
}
def parse(response, url:, data: {})
logger.info response.title
end
end
ExampleSpider.crawl!