难以刮擦的桌子

时间:2020-09-19 07:14:27

标签: selenium

我无法从某个页面获取表格。尝试了各种等待命令,但不起作用。希望获得帮助吗?

from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
import pandas as pd
from bs4 import BeautifulSoup

options = Options()
options.headless = True
options.add_argument("--window-size=1920,1200")
DRIVER_PATH = r'c:\Users\AB\Dropbox\ITProjects\Scraping\chromedriver.exe'
driver = webdriver.Chrome(options=options, executable_path=DRIVER_PATH)
url = 'https://tenderbulletin.eskom.co.za/'
#url = 'https://www.nintendo.com/'
#driver.implicitly_wait(10) # seconds
driver.get(url)
WebDriverWait(driver, 30).until(EC.visibility_of_element_located((By.CLASS_NAME, 'ng-binding')))
soup = BeautifulSoup(driver.page_source, 'lxml')
#print(soup)
#print(driver.title)
#dfs = pd.read_html(soup)
driver.quit()

0 个答案:

没有答案