Using selenium to write to Chrome console

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP



Using selenium to write to Chrome console



I'm wondering if it is possible to use Selenium to write to the Chrome console with python. I do not mean by using send_keys to press F12 and open the console then send more keys to write. If this isn't possible, are they any libraries or APIs that would let me do this? Thanks!




1 Answer
1



You can look at the problem with another view, try to use browser.execute_script and pass console.log("whatever you want to write in the console") , this will print that sentence in the console


browser.execute_script


console.log("whatever you want to write in the console")



You can of course change it to your own needs but you get the idea





Thank you, this works perfectly!
– Tom
Aug 11 at 23:35





Please mark this as solved if it did help
– Souames
Aug 11 at 23:36






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Firebase Auth - with Email and Password - Check user already registered

Dynamically update html content plain JS

Creating a leaderboard in HTML/JS