Added the use of multithreading

This commit is contained in:
2024-03-22 21:52:54 -04:00
parent 13f7bf6f07
commit 095f7cc295
2 changed files with 61 additions and 17 deletions

3
upc.py
View File

@ -1,10 +1,11 @@
import time
from seleniumbase import Driver
# from selenium import webdriver
driver = Driver(uc=True)
driver.implicitly_wait(5)
def get_name_from_upc(upc: str, wait_interval=3, max_tries=10) -> str:
def get_name_from_upc(upc: str, wait_interval=1, max_tries=30) -> str:
url = "https://stocktrack.ca/wm/index.php?s=wm&upc=" + upc
driver.get(url)