

where python
import time from selenium import webdriver # 创建Chrome浏览器驱动 driver = webdriver.Chrome() # 打开网页 url = 'https://www.zhihu.com/search?type=content&q=sport' driver.get(url) # 获取网页源代码 html = driver.page_source title = driver.title print(title) # 阻塞3秒 time.sleep(30) # 关闭浏览器驱动 driver.quit() # 输出网页源代码 print(html)