Merge branch 'master' of github.com:Kanezoh/mechanize.cr

This commit is contained in:
Kanezoh 2021-07-15 09:01:56 +09:00
commit 976f2b3d68
3 changed files with 6 additions and 3 deletions

View File

@ -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

View File

@ -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)

View File

@ -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