以编程方式打印网页

以编程方式打印网页

本文介绍了以编程方式打印网页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在制作一个自动去网站打印页面的程序,似乎无法使其工作,我尝试了selenium chrome驱动程序,问题是它不起作用。我试过action.sendkeys键ctrl + shift +p无济于事,最大的问题是打印预览弹出窗口。我尝试发送JavaScript命令:window.print(),但chrome中的打印预览以我的方式,因为你需要按回车键。有没有一种方法在JavaScript中模拟按ENTER键?请帮助

I am making a program to automatically go to a website and print a page, Can't seem to make it work, I tried selenium chrome driver, problem is it doesn't work. i tried action.sendkeys keys ctrl + shift + "p" to no avail, biggest problem is print preview pop-up. I tried sending JavaScript command: window.print(), but the print preview in chrome stands in my way, because you need to press enter. Is there a way in JavaScript to simulate the pressing of the ENTER key? Please help

推荐答案


这篇关于以编程方式打印网页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-31 05:41