Home > Software engineering >  How to write a python program to interact with the browser?
How to write a python program to interact with the browser?

Time:03-26

In my company intranet, any request to an external website X in Internet will be redirected to an internal page containing a button that I have to click on. Then the external website X in Internet will be loaded.

I want to write a program that automatically clicks this button for me (so I don't have to click it manually). After that, the program will make the browser redirect to a re-configured website Y (not X) for the purpose of security testing.

I don't have much experience with Python. So I would be really thankful if someone can tell me how I can write such a program.

Many thanks

CodePudding user response:

unfortunately it can get a little complicated once you're interacting with javascript elements like buttons. However, the best way to approach this would be with selenium. There's a slight learning curve but thankfully the documentation is good and there are many resources online to show you how to get started.

CodePudding user response:

Python has Selenium and BS4 library to help You out, but if You are not experienced with python, You might as well pick up node.js and puppeteer, its far superior in my opinion.

  • Related