diff --git a/src/doms_databasen/scraper.py b/src/doms_databasen/scraper.py index 7343f7a1..6333e790 100644 --- a/src/doms_databasen/scraper.py +++ b/src/doms_databasen/scraper.py @@ -234,11 +234,6 @@ def _download_pdf(self, case_dir: Path) -> None: download_element.click() file_name = self._wait_download(files_before=files_before_download) if file_name: - # print cwd - print("cwd", os.getcwd()) - # list dir - print("listdir", os.listdir()) - from_ = self.download_dir / file_name to_ = case_dir / self.config.file_names.pdf_document shutil.move(from_, to_) @@ -313,10 +308,8 @@ def _element_exists(self, xpath) -> bool: logger.error(e) raise e - # # When closing the scraper, the webdriver should be closed. - # # and the download folder should be deleted. - # def __del__(self): - # """Closes the scraper.""" - # self.driver.quit() - # shutil.rmtree(self.download_dir) - # logger.info("Scraper closed") + def __del__(self): + """Closes the scraper.""" + self.driver.quit() + shutil.rmtree(self.download_dir) + logger.info("Scraper closed") diff --git a/tests/scraper/conftest.py b/tests/scraper/conftest.py index ccd5bc74..3e4c8c21 100644 --- a/tests/scraper/conftest.py +++ b/tests/scraper/conftest.py @@ -33,7 +33,7 @@ def pytest_sessionstart(session): ) scraper = DomsDatabasenScraper(config=config) case_id = str(config.scrape.test_case_id) - scraper.scrape(case_id) + scraper.scrape(case_id=case_id) session.__CACHE = scraper.test_dir