configure with Path

This commit is contained in:
Dmitry Afanasyev 2022-08-13 16:30:02 +03:00
parent 818c5bf317
commit 249a198401
4 changed files with 1 additions and 3 deletions

0
app/__init__.py Normal file
View File

0
app/core/__init__.py Normal file
View File

View File

@ -36,7 +36,7 @@ def configure_firefox_driver(private_window: bool = False) -> WebDriver:
opt.add_argument(f'{Path.home()}/snap/firefox/common/.mozilla/firefox')
if private_window:
opt.set_preference("browser.privatebrowsing.autostart", True)
service = Service(executable_path=str(BASE_DIR / 'geckodriver'))
service = Service(executable_path=BASE_DIR / 'geckodriver')
firefox_driver = webdriver.Firefox(service=service, options=opt)
return firefox_driver
@ -79,5 +79,3 @@ def parse_site(driver: WebDriver, url: str, message: str) -> str:
if bus_t19:
answer += f'Автобус {bus_t19.text} - {bus_t19_arrival.text}'
return answer
download_gecko_driver()

BIN
app/geckodriver Executable file

Binary file not shown.