I have two python scripts. In one script, "start_browser.py", I open the browser on the page I need:
from selenium import webdriver
drv = webdriver.Chrome(options=options)
drv.get('http//some_site')
In the second script, I have the code to fill in the web form "web_form.py:
drv.find_element_by_xpath('//some_xpath"]').value = 'some_text'
How can I use the drv
defined in the first script in the second script to continue working in a browser open with the first script "start_browser.py"?
When I try to execute this code in the second script, I get an error:
NameError: name 'drv' is not defined
UPD: I will change my question. In other words, I need so that I can launch the browser by pressing one button (for example, in tkinter), and then after loading the browser, run another script by pressing another button and the window created on tkinter and do further actions in the browser that is already open with driver defined in first script