Skip to content

Instantly share code, notes, and snippets.

@Abhayparashar31
Created December 11, 2020 06:13
Show Gist options
  • Save Abhayparashar31/354ace2a57ec39fc044a00be64dc3e2d to your computer and use it in GitHub Desktop.
Save Abhayparashar31/354ace2a57ec39fc044a00be64dc3e2d to your computer and use it in GitHub Desktop.
import requests
url = "link-to-webpage"
apiKey = "your-api-key"
linkRequests = f"https://api.html2pdf.app/v1/generate?url={url}&apiKey={apikey}"
result = requests.get(linkRequests).content
with open("document.pdf", "wb") as handler:
handler.write(result)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment