def finished(self):
try:
# make sure js has executed
wait = WebDriverWait(self, 10)
wait.until(jQuery_load())
wait.until(jScript_load())
# deal with buttons which may change the content
if self._experiment:
_url = self.current_url
self.click_buttons()
if _url != self.current_url:
logger.error("[error]page direct from %s to %s" % (_url, self.current_url))
page = Page(self.current_url, self.page_source, self._depth)
self.onfinish(page)
except Exception as e: # TimeoutException:
logger.error("error!!")
logger.error(e)
traceback.print_exc()
self.onfinish(None)
# support with notation 'with'
评论列表
文章目录