2

I'm wondering if it's possible to use webbrowser.open() method, open the browser, get its handler (?), and use it in driver = webdriver.Chrome() command somehow (webdriver is from selenium)?

Is it feasible at all?

I'm using Python.

Ajeet Verma
  • 2,938
  • 3
  • 13
  • 24
psmith
  • 1,769
  • 5
  • 35
  • 60
  • Does this answer your question? [Can Selenium interact with an existing browser session?](https://stackoverflow.com/questions/8344776/can-selenium-interact-with-an-existing-browser-session) – MendelG Aug 06 '23 at 18:37
  • The post was about switching between selenium browsers. I'm asking if it possible to take from selenium over non-selenium browser. – psmith Aug 06 '23 at 19:27
  • You can attach to a debug session, so just launch with command line switch of "chrome.exe --remote-debugging-port=9222" (use whatever port you like) then you can launch selenium and set it to use the same port. This is commonly used when attaching a debugger to a site you are developing. You should be able to add switches when using webbrowser.open(). – pcalkins Aug 07 '23 at 22:16

1 Answers1

3

No, webbrowser.open() is from another package unrealted to Selenium.

To interact with Selenium you have to use a Selenium driven WebDriver initiated Browsing Context.

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
  • 1
    ok. that answers my question. I tried undetected Selenium but it's also blocked. It was working last week but somehow now it's stuck on 'Verify you are human'... Have no clue what to do... – psmith Aug 06 '23 at 19:30