0

I need to insert some log-points in a JavaScript that interprets some websocket data on a homepage. I can easily insert the logpoints by inserting them manually using the developer tools in Chrome. However, I would like automize this by doing it programmatically using python selenium. Is it possible to insert a logpoint in the JavaScript from python using selenium and ChromeDriver (or alternatively Firefox and Geckdriver)?

Here is a screenshot from the developer tools of what I would like to be able to do from python:

enter image description here

Per
  • 43
  • 5
  • what do you mean by log points? debugger breakpoints? – pguardiario Feb 24 '23 at 01:38
  • Yes, so break points that do not stop the code from executing, but primts a message in the console. – Per Feb 24 '23 at 02:01
  • are you asking how to call console.log from python? – pguardiario Feb 24 '23 at 02:23
  • No, the question if it is possible to insert a "console log break point" in the JavaScript from python. – Per Feb 24 '23 at 02:36
  • I don't think there's such a thing. Maybe you should share a screenshot of what you're doing in dev tools – pguardiario Feb 24 '23 at 03:15
  • Hi @pguardiario, I have shared a screen shot of what I am trying to do. Another solution that would work for me would be to set up an override of the JavaScript such as it is done here [Override Javascript file in chrome](https://stackoverflow.com/questions/35580017/override-javascript-file-in-chrome) but also here I am stuck with figuring out how to do this from Python – Per Feb 24 '23 at 07:57

0 Answers0