79149670

Date: 2024-11-01 23:41:28
Score: 2
Natty:
Report link

Try using route.request

def handle_request(route):
    headers = route.request.headers
    if "match_string" in route.request.url:
        headers['custom_header_1'] = 'value_!23'
    route.continue_(headers=headers)

See also this sample from the official documentation:

https://playwright.dev/python/docs/network#modify-requests

Reasons:
  • Probably link only (1):
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: CodeResearcher