from selenium import webdriver
from selenium.webdriver.common.keys import Keys
driver = webdriver.Chrome(executable_path="D:\documents\Downloads\Compressed\chromedriver_win32\chromedriver.exe")
url = 'http://sthj.gansu.gov.cn/sthj/c112982/list.shtml'
driver.get(url)
# assert "省厅要闻" in driver.title
elem = driver.find_element_by_css_selector(".news-list")
print(elem)
driver.close()
补充:requests库最早试的,带上普通访问时的cookie也不行。 用selenium_Chrome也是没有像普通浏览器一样“执行jsq然后跳转” ,怎么回事。
pyppeteer也试了,也是拿不到最终的html code