Export a single Confluence page as PDF (Python)

I have a python script which is trying to export a confluence page as pdf and have tried several methods unsuccessfully:


wget --ask-password --user xxxxxxxx -O out.pdf -q http://confluence.xxxx.com/spaces/flyingpdf/pdfpageexport.action?pageId=xxxxxxxx

This won't work because it just returns a login dialog rather than the actual pdf.


Using: https://developer.atlassian.com/confdev/deprecated-apis/confluence-xml-rpc-and-soap-apis/remote-confluence-methods#RemoteConfluenceMethods-Pages

There is an exportSpace method which works but I only want a single page, the getPage method doesn't export to pdf as far as I can tell. Also this is technically deprecated so Atlassian instead recommends:


Using: https://docs.atlassian.com/atlassian-confluence/REST/latest-server/

This doesn't seem to have an option to export a page as PDF

I would appreciate an answer that makes any of these methods work or if you have a completely different approach, I don't care as long as I can get the PDF of the page from a python script.