Created
November 16, 2019 14:16
-
-
Save ettorerizza/afe473b9b378110b0bd2e178e5b5d375 to your computer and use it in GitHub Desktop.
to improve
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
CHROME_PATH = r"/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome" | |
url = "https://www.tidytextmining.com/tfidf.html" | |
def url_to_pdf(url, filename): | |
chrome_args = [CHROME_PATH, | |
'--headless', | |
'--disable-gpu', | |
f'--print-to-pdf={filename}.pdf', | |
url, ] | |
cmd = r" ".join(chrome_args) | |
os.system(cmd) | |
url_to_pdf(url, "sds") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment