-3

I am trying to get the current url opened in my pc in any browser using python.

I tried selenium it worked but it opens up a new browser window. I only want to get the current url opened in the browser.

Any help would be appreciated.

petezurich
  • 9,280
  • 9
  • 43
  • 57
satyam
  • 1
  • 2
  • Be aware that such functionality would be considered intrusive. The only way to do this with Python would be to actually hook into the process associated with your web browser and examine the memory within it. – h0r53 Jun 13 '19 at 14:55

2 Answers2

0

use keylogger in python, that would easiest solution, orelse you should catch each and every packets in network.

Jainil Patel
  • 1,284
  • 7
  • 16
0

Selenium isn't made for such purposes. It can be used to automate testing of websites or for website scraping. Selenium associated with a driver (like Chrome's driver for example) is just a fancy browser that let's you interact with it in a non-intrusive way.

If you need to interact with already running apps, you could attach to another process's memory and read stuff directly from there but it might be very messy.

Also, see: Interact with other programs using Python

asikorski
  • 882
  • 6
  • 20