我已经尝试了所有我能在互联网上找到的解决方案,以便能够用Python打印一个用Selenium打开的页面。然而,当打印弹出窗口出现时,一两秒钟后它就消失了,没有保存PDF文件。在
用mojave10.14.5在Mac上编码。在from selenium import webdriver
from selenium.webdriver.support.select import Select
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.common.exceptions import NoSuchElementException
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.chrome.options import Options
from selenium.common.exceptions import WebDriverException
import time
import json
options = Options()
appState = {
"recentDestinations": [
{
"id": "Save as PDF",
"origin": "local"