【Python网络编程】selenium之等待页面异步加载完成

# 需要导入的库
import
os import time from selenium import webdriver from selenium.webdriver.support.wait import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.common.by import By import base64 import gevent import datetime from gevent import monkey monkey.patch_all()

...

   # 1.先声明browser

  browser = webdriver.PhantomJS('phantomjs路径,系统环境变量有,参数为空即可')
  browser.get('浏览器地址')
  locator = (By.CSS_SELECTOR, '#sorting_1')
  tables = wait.until(
  EC.presence_of_all_elements_located(locator)
  )




 

转载于:https://www.cnblogs.com/vichurd/p/8533514.html

你可能感兴趣的:(【Python网络编程】selenium之等待页面异步加载完成)