CDM, fix broken things

This commit is contained in:
oitsjustjose 2023-08-13 17:36:16 -05:00
commit cc912292e2

View file

@ -12,6 +12,8 @@ from pywinauto import Desktop
from pywinauto.controls.hwndwrapper import InvalidWindowHandle from pywinauto.controls.hwndwrapper import InvalidWindowHandle
from selenium import webdriver from selenium import webdriver
from selenium.webdriver.chrome.options import Options from selenium.webdriver.chrome.options import Options
from selenium.webdriver.chrome.service import Service
from webdriver_manager.chrome import ChromeDriverManager
import pixlet import pixlet
from images import loadout_to_b64 from images import loadout_to_b64
@ -58,14 +60,14 @@ def get_salmon_run_data() -> List[SalmonRunEvent]:
options = Options() options = Options()
options.add_argument("--headless") options.add_argument("--headless")
options.add_experimental_option("excludeSwitches", ["enable-logging"]) options.add_experimental_option("excludeSwitches", ["enable-logging"])
driver = webdriver.Chrome(options=options) driver = webdriver.Chrome(
service=Service(ChromeDriverManager().install()), options=options
)
driver.get("https://splatoon.oatmealdome.me/three/salmon-run") driver.get("https://splatoon.oatmealdome.me/three/salmon-run")
main_el = driver.page_source main_el = driver.page_source
main_el = BeautifulSoup(main_el, features="html.parser") main_el = BeautifulSoup(main_el, features="html.parser")
main_el = main_el.body.find("main", attrs={"role": "main"}).find( main_el = main_el.body.find("main").find("div", attrs={"class": "d-grid gap-3"})
"div", attrs={"class": "d-grid gap-3"}
)
# The row where the datetime is shown when the evt. will occur # The row where the datetime is shown when the evt. will occur
times: List[str] = [ times: List[str] = [