# 需要導入的庫
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)
)
