0

I am searching for a way which allows me to interact with a webrowser (Firefox,Chrome/Chromium,Edge are the most important).

I am currently using pyautogui, to locate login,password fields to put the login data into them. But since you can extract much easier informations when you can use IDs or xPath or other identifiers on webpages, it would make sense to use that.

I tried Firefox with selenium but I run in some problems. Can I attache it to a user created session (do I need the processID or something like that?). (Can I choose between the normal private session of the current profile?

I need a solution which works on Windows and Linux(it would be nice if the major Linux distros would support it. But the most important distros are Fedora/Ubuntu for me.) mac would be optional but since I do not got any mac I am not able to test it anyway. The way with debugger mode or similar does not work really well for me since the browser needs to get started in a special way.

Would it possible to use something like this: Can Selenium interact with an existing browser session? , When I can retrieve the this information some how form the existing browser?

driver.command_executor._url
driver.session_id 

(But when I understand that currently it only works with browsers started with selenium?)

When I use Selenum and start a browserwindow with it can I login to a website and the user is logged in on the webside on his browser window too(if they us the same profile)? (Or does selenium separate cookies?)

If you need additional information or have some hints please post them so I can see them.

Thank you in advance for your help

DJPX
  • 56
  • 1
  • 8
  • You can't attach to a browser that has not been launched in dev/debug mode. – pcalkins Mar 01 '22 at 18:02
  • It is not necessary to attach to the browser an API or a other libery would work too selenium just was the first try to get it working. – DJPX Mar 02 '22 at 17:55

1 Answers1

0

It seems that it is not possible to connect to a web browser which was opened by the user to my understanding. How ever I found two possible solutions which I am currently trying to evaluate. Using pyautogui to access the web browser over scanned images and control it with keyboard and mouse. (It is possible to access the console with the right combinations too).

The other solution is maybe more stable. Writing an browser extension which controls the browser.

DJPX
  • 56
  • 1
  • 8