Why playwright miss pattern url?

Question:

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?

Asked By: kshnkvn

||

Answers:

Try using a regular expression instead

await page.route(/^.*/api/common/v1/play?.*$/, handle_data_route)
Answered By: noah1400