Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有谁知道如何获取我使用mechanize浏览器登录的 cookie,以便我可以使用这些网址pdfkit?我环顾四周,但无法看到如何以正确的格式获取 cookie 并将其传递给pdfkit.from_url.
mechanize
pdfkit
pdfkit.from_url
wkhtmltopdf支持使用--cookie选项设置 cookie,从 中提取 cookie ,使用参数mechanize browser传递给:wkhtmltopdfoptionspdfkit.from_url
wkhtmltopdf
--cookie
mechanize browser
options
cj = br.cookiejar # assume `br` is a `browser` intance ops = {'cookie': [(c.name, urllib.quote(c.value)) for c in cj]} pdfkit.from_url('url', options=ops)