selenium.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:SerpScrap 作者: ecoron 项目源码 文件源码
def _wait_until_search_param_fields_appears(self, max_wait=5):
        """Waits until the search input field contains the query.

        Args:
            max_wait: How long to wait maximally before returning False.
        """
        def find_visible_search_param(driver):
            for _, field in self._get_search_param_fields().items():
                input_field = driver.find_element(*field)
                if not input_field:
                    return False
            return True

        try:
            fields = WebDriverWait(self.webdriver, max_wait).until(find_visible_search_param)
            return fields
        except TimeoutException as e:
            logger.error('{}: TimeoutException waiting for search param field: {}'.format(self.name, e))
            return False
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号