Merge branch 'master' of github.com:Kanezoh/mechanize.cr
commit
976f2b3d68
|
@ -83,7 +83,7 @@ class Mechanize
|
|||
|
||||
def parse(uri, response, body)
|
||||
code = response.not_nil!.status_code
|
||||
MechanizeCr::Page.new(uri, response, body, code)
|
||||
MechanizeCr::Page.new(uri, response, body, code, self)
|
||||
end
|
||||
|
||||
def history
|
||||
|
|
|
@ -78,7 +78,7 @@ module MechanizeCr
|
|||
end
|
||||
|
||||
private def response_parse(response, body, uri)
|
||||
@context.not_nil!.parse uri, response, body
|
||||
@context.not_nil!.parse(uri, response, body)
|
||||
end
|
||||
|
||||
private def add_response_cookies(response, uri, page)
|
||||
|
|
|
@ -5,7 +5,10 @@ class MechanizeCr::Page < MechanizeCr::File
|
|||
include MechanzeCr::ElementMatcher
|
||||
delegate :css, to: parser
|
||||
|
||||
def initialize(uri, response, body, code)
|
||||
property mech : Mechanize?
|
||||
|
||||
def initialize(uri, response, body, code, mech=nil)
|
||||
@mech = mech
|
||||
super(uri, response, body, code)
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue