Class: HttpCrawler::Web::Baidu::Client
- Inherits:
-
Object
- Object
- HttpCrawler::Web::Baidu::Client
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("/", )
r.extend(HttpCrawler::Web::Baidu::Response::Index)
end
|
#init_http ⇒ Object
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
|
14
15
16
|
# File 'lib/http_crawler/web/baidu/client.rb', line 14
def init_uri
@uri = URI("https://www.baidu.com/")
end
|