Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not compatible with newer versions of playwright #16

Open
PATAPOsha opened this issue May 29, 2023 · 0 comments
Open

Not compatible with newer versions of playwright #16

PATAPOsha opened this issue May 29, 2023 · 0 comments

Comments

@PATAPOsha
Copy link

Everything works fine on playwright==1.27.1
But when updating playwright to 1.31.1 -- all "interception/modifying requests" methods stop working.
like

        def intercept(route: Route, request: Request):
            headers = {
                **request.headers,
                "sec-fetch-site": "same-origin",
                "sec-fetch-mode": "no-cors",
                "sec-fetch-dest": "script",
                ...
            }
            response = self.page.request.fetch(request, headers=headers)
            body = response.text()
           ...

            route.fulfill(
                response=response,
                body=body,
                headers=response.headers,
            )

        self.page.route("*/init.js", intercept)

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant