Export as PDF using Selenium Webdriver Screenshot

后端 未结 3 562
梦毁少年i
梦毁少年i 2020-12-10 15:23

Does anyone know if it\'s possible to export HTML to PDF using the screenshot feature in Selenium Firefox WebDriver? I have a webpage which has print specific css which I ne

3条回答
  •  轮回少年
    2020-12-10 16:07

    Webdriver doesn't support "Export As PDF" function.

    When you are not bound to Firefox and Webdriver, phantomjs could be an alternative. Phantomjs is a headless browser with the ability to take screenshots as PDF. The browser can be controlled directly by javascript.

    Example: http://phantomjs.org/screen-capture.html

提交回复
热议问题