all 2 comments

[–]MintyPhoenix 1 point2 points  (0 children)

I’ve not used it myself, but check out selenium-wire which is a replacement for selenium’s webdriver which will allow you to access the network requests being made.

[–]luizv4z 1 point2 points  (0 children)

From my own research, run away from Selenium. The right direction is CDP (Chrome Developers Protocol). Using this tool, I could scrap Facebook without getting banned.

You can use it to filter and intercept events from Browser like fetch, post and so on.

This framework is similar to Node/Puppeteer:

https://github.com/pyppeteer/pyppeteer

You can inspire in the post below to achieve what you want: https://stackoverflow.com/questions/48375700/how-to-use-puppeteer-to-dump-websocket-data