Closed zenghh closed 2 years ago
The reason is that you are using time.sleep()
. If you replace it with page.wait_for_timeout(500)
it works as expected, see here for more information: https://playwright.dev/python/docs/intro#timesleep-leads-to-outdated-state
Your question
when i run this to listen websocket, i just see websocket open msg
and when i add page.wait_for_selector("aaaa", timeout=1000000) wai for an nonexist selector, i can listen all ws msg, but how can i listen all ws msg in an regular way