[Python] Python, convert web page to pdf [closed]

Discussão em 'Python' iniciado por Stack, Março 12, 2025.

  1. Stack

    Stack Membro Participativo

    Please tell me how to convert a url (website page) to pdf using python? url = "http://online.mytemscloud.com/TD/26.1/HtmlHelp/index.html#page/User%2520Guide%2FTEMS%2520Discovery%2520User%2520Guide.1.17.html"

    On another similar resource, the task was solved through selenium. The site has a special "print" button, when pressed, the entire page with the invisible part is displayed in "print to pdf". url1 = "http://online.mytemscloud.com/TI/26.1/HtmlHelp/index.html"

    Please tell me what I can try to do and in what direction to look? The task is not regular - I need to merge two sources. But I would like to understand the assignment and get practice in python. Thanks for the help to those who responded.

    I tried pdfkit. It doesn’t work - the page/template without content is converted. Tried via Selenium via "print to pdf" - only the visible part is saved. Scrolling the visible part via execute_script does not work. Tried scrolling through selenium via "page_down". Scrolling works but I can't determine the position of the visible part and how much of the invisible part is left.

    Continue reading...

Compartilhe esta Página