Class: HttpCrawler::Web::Baidu::Client

Inherits:
Object
  • Object
show all
Includes:
Client
Defined in:
lib/http_crawler/web/baidu/client.rb

Instance Attribute Summary

Attributes included from Client

#http, #uri

Instance Method Summary collapse

Methods included from Client

#auto_proxy=, for, for_module, #header, #init_header, #initialize, #update_header, #update_proxy, #validation_page?

Instance Method Details

#index(parameter = {}) ⇒ Object



18
19
20
21
# File 'lib/http_crawler/web/baidu/client.rb', line 18

def index(parameter = {})
  r = http.get_fetch("/", header)
  r.extend(HttpCrawler::Web::Baidu::Response::Index)
end

#init_httpObject



9
10
11
12
# File 'lib/http_crawler/web/baidu/client.rb', line 9

def init_http
  @http.open_timeout = 3
  @http.read_timeout = 3
end

#init_uriObject



14
15
16
# File 'lib/http_crawler/web/baidu/client.rb', line 14

def init_uri
  @uri = URI("https://www.baidu.com/")
end