python selenium 用Chrom截图为黑色?如何修改?代码如下:
from selenium import webdriver from selenium.webdriver.chrome.options import Options url='http://218.77.183.36:9088/ICPSP/pdf.action?id=141000029831329161' driver = webdriver.Chrome() driver.maximize_window() # 设置打开页面最大化,目的是更好的截取错误图 driver.get(url=url) driver.get_screenshot_as_file('baidu.png') driver.quit()