I need to convert a javascript intensive webpage given an URL like domain.com?client_id=test_client&token=ggvv68566fgjj into pdf, if I open the URL into browser it open rights away but if using pdfkit code-
import pdfkit
url=domain.com?client_id=test_client&token=ggvv68566fgjj
pdfkit.from_url(url, 'out.pdf', options = {'javascript-delay':'9000'})
does fetch the partial page because it can not authenticate.
As it is a wrapper of wkhtmltopdf I tried these on terminal
wkhtmltopdf --custom-header "Authentication" "Token ggvv68566fgjj" --custom-header-propagation --javascript-delay 5000 --debug-javascript "domain.com?client_id=test_client&token=ggvv68566fgjj" output.pdf
Access header authentication error is raised and pdf does not contain all data as API authentication failed.
Any suggestions and advice would be of great help.