from seleniumimport webdriver
from selenium.webdriver.chrome.option simport Options
chrome_options= Options()
chrome_options.add_argument('--headless')
driver= webdriver.Chrome(chrome_options=chrome_options)
driver.implicitly_wait(6)
driver.get("file:///E:/ChromeDownload/log.html")
source= driver.page_source
print(source)
time.sleep(1)
driver.get_screenshot_as_file("C:\\Users\\Administrator\\Desktop\\baidu.png")
网友评论