kshnkvn
kshnkvn

Reputation: 956

Why playwright miss pattern url?

I need to handle request with certain url and im trying to do it like this:

await page.route("**/api/common/v1/play?**", handle_data_route)

But it also handles a url like this: api/common/v1/play_random?

Upvotes: 0

Views: 1923

Answers (1)

noah1400
noah1400

Reputation: 1509

Try using a regular expression instead

await page.route(/^.*\/api\/common\/v1\/play\?.*$/, handle_data_route)

Upvotes: 0

Related Questions