我試圖用Python和selenium下載這張website的PDF幻燈片,但我認爲載入幻燈片的鏈接僅在加載腳本後出現。我試圖等待JavaScript加載,但它仍然沒有找到任何東西。有任何想法嗎?Selenium沒有得到PDF鏈接的HTML
import os, sys, time, random
import requests
from selenium import webdriver
from bs4 import BeautifulSoup
url = 'https://mila.umontreal.ca/en/cours/deep-learning-summer-school-2017/slides'
browser = webdriver.Chrome()
browser.get(url)
browser.implicitly_wait(3)
html = browser.page_source
links = browser.find_elements_by_class_name('flip-entry')
print(links)
browser.quit()
乍一看:你爲什麼要設置'HTML = browser.page_source',而不是使用'html'? – JacobIRR