Python code here

 def process_response(self, request, response, spider):
        if response.headers.get("Transfer-Encoding") == "chunked":
            body = decode_chunked_transfer(response.body)
            return response.replace(body=body)
        return response

what does this mean by response.replace (body=body) here? Body=body, what is this?

Jan.20,2022

body is the parameter in the replace function called body , and the body after = body is the variable body

in your function. < hr >

for example, I have a function

def test(a=1, b=2):
    print(a,b)
    
 test(b=4)

A meaning

for specific implementation, you can ctrl+ the left button Click on the function and see the function prototype


take a look at the specific implementation of the source code to get a general idea.

Menu