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?
Answers:
Try using a regular expression instead
await page.route(/^.*/api/common/v1/play?.*$/, handle_data_route)
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?
Try using a regular expression instead
await page.route(/^.*/api/common/v1/play?.*$/, handle_data_route)