Eel
Eel copied to clipboard
THREADING ERROR
Im trying to execute two selenium in differente threads, but it executed one and then the second:
from seleniumwire import webdriver
from webdriver_manager.chrome import ChromeDriverManager
import eel
eel.init('web')
def my_other_thread(numero):
'''while True:
print("I'm a thread " + numero)
eel.sleep(1.0) # Use eel.sleep(), not time.sleep()
'''
eel.sleep(1.0)
driver = webdriver.Chrome(
ChromeDriverManager().install())
driver.get("https://www.google.com")
for i in range(6):
driver.get(driver.current_url)
eel.spawn(my_other_thread, "1")
eel.spawn(my_other_thread, "2")
eel.start('main.html', block=False) # Don't block on this call
while True:
print("I'm a main loop")
eel.sleep(1.0)