Hack Forums
[Python] Save Firefox console to file? - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [Python] Save Firefox console to file? (/showthread.php?tid=5882760)



Save Firefox console to file? - Chukozy - Sep 8, 2018

Hey! I'm using Selenium with Firefox and I wanted to interact Python with the logs that appear in the console on Firefox.

I've come to the conclusion Python/Selenium cannot read the console "directly" (based on the research I have done), so I have become desperate and thought maybe there are other ways of saving the logs into a file?

Does anyone have any input?


RE: Save Firefox console to file? - .kr. - Sep 8, 2018

I found this:
https://stackoverflow.com/questions/25431380/capturing-browser-logs-with-selenium-webdriver-using-java

You could use this:
Code
LogEntries logs = driver.manage().logs().get("browser");

Another idea is to overwrite console.log and store the los where selenium can read it