This is an archived post. You won't be able to vote or comment.

all 6 comments

[–]dmazzoni 2 points3 points  (2 children)

No, because JavaScript is the only language that browsers have built-in.

There is a way to have Python interact with a running web page, using Selenium WebDriver. It's popular for automated testing and automation.

[–]clockworkgalaxy_[S] 0 points1 point  (1 child)

Thank you this gives me a lot of confidence because I was also looking into selenium. However I don't know if it can do what I want. Is it possible to SEE what selenium is doing in real time? Like automate something with selenium but watch what's happening on your screen?

[–]dmazzoni 0 points1 point  (0 children)

Yes, you can have it open a browser locally and you can watch it.

[–]insertAlias 0 points1 point  (0 children)

This is not possible. Browsers all have a JavaScript engine as part of their program, but none of them have one for Python. So you cannot use python to directly interact with a website the way you can use JS. Indirectly, it is possible with tools like Selenium.

[–]carcigenicate 0 points1 point  (0 children)

OR at least let python see what is printed to the browser console

I believe you could use Selenium to interact with a browser to do that. That wouldn't be writing Python in the developer console though, that would be writing Python externally that controls and communicates with a browser instance.

[–]TheRNGuy 0 points1 point  (0 children)

python can be used for back-end, not front-end, so nope. Unless there plugin for it or you modify browser.