From 31dea53dd2b8323bdfc36cbcc76729974d8585b3 Mon Sep 17 00:00:00 2001 From: Brandon Roberts Date: Sat, 11 Apr 2020 18:39:35 -0700 Subject: [PATCH] Fix import error and use correct driver for loadwait --- autoscrape/backends/selenium/browser.py | 2 +- autoscrape/backends/selenium/dom.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/autoscrape/backends/selenium/browser.py b/autoscrape/backends/selenium/browser.py index 875a96b..2e0d1d8 100644 --- a/autoscrape/backends/selenium/browser.py +++ b/autoscrape/backends/selenium/browser.py @@ -223,7 +223,7 @@ def _wait_check(self, driver): """ logger.debug(" - Waiting for page to load (document.readyState)...") script = "return document.readyState" - result = self._driver_exec(self.driver.execute_script, script) + result = driver.execute_script(script) return result == "complete" def _loadwait(self, fn, *args, **kwargs): diff --git a/autoscrape/backends/selenium/dom.py b/autoscrape/backends/selenium/dom.py index 03f94ac..3dcf4f7 100644 --- a/autoscrape/backends/selenium/dom.py +++ b/autoscrape/backends/selenium/dom.py @@ -1,5 +1,6 @@ # -*- coding: UTF-8 -*- import logging +import re try: from selenium.common.exceptions import (