Quellcode durchsuchen

Added path to geckodriver

master
Jim Martens vor 3 Monaten
Ursprung
Commit
76f77058c0
2 geänderte Dateien mit 5 neuen und 3 gelöschten Zeilen
  1. +1
    -0
      src/twomartens/allrisscraper/definitions.py
  2. +4
    -3
      src/twomartens/allrisscraper/internal.py

+ 1
- 0
src/twomartens/allrisscraper/definitions.py Datei anzeigen

@@ -77,6 +77,7 @@ CONFIG_PROPS = {
"pdflocation": "/Pfad/zum/Ablegen/der/PDFs/",
"jsonLocation": "/Pfad/zum/Ablegen/der/jsons/",
"firefoxBinary": "/Pfad/zur/firefox.exe",
"geckodriver": "/Pfad/zum/geckodriver"
}
}



+ 4
- 3
src/twomartens/allrisscraper/internal.py Datei anzeigen

@@ -36,7 +36,7 @@ def main(_) -> None:
config_file = f"{os.getcwd()}/tm-allris-scraper-config.ini"
if not config_module.initialize_config(config_file):
return
config = configparser.ConfigParser()
config.read(config_file)
district = config["Default"]["district"]
@@ -44,14 +44,15 @@ def main(_) -> None:
password = config["Default"]["password"]
pdf_location = config["Default"]["pdflocation"]
firefox_binary = config["Default"]["firefoxBinary"]
geckodriver = config["Default"]["geckodriver"]
base_url = definitions.BASE_LINKS[district]
options = Options()
options.headless = True
binary = FirefoxBinary(firefox_binary)
driver = webdriver.Firefox(firefox_binary=binary, options=options)
driver = webdriver.Firefox(firefox_binary=binary, options=options, executable_path=geckodriver)
driver.delete_all_cookies()
driver.implicitly_wait(2)
driver.implicitly_wait(5)
driver.get(ALLRIS_LOGIN)
login(driver, username=username, password=password)
driver.get("https://serviceportal.hamburg.de/HamburgGateway/Service/StartService/ALLMAnd")


Laden…
Abbrechen
Speichern