소스 검색

Added path to geckodriver

master
Jim Martens 3 달 전
부모
커밋
76f77058c0
2개의 변경된 파일5개의 추가작업 그리고 3개의 파일을 삭제
  1. +1
    -0
      src/twomartens/allrisscraper/definitions.py
  2. +4
    -3
      src/twomartens/allrisscraper/internal.py

+ 1
- 0
src/twomartens/allrisscraper/definitions.py 파일 보기

@@ -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 파일 보기

@@ -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")


불러오는 중...
취소
저장