Is it technically possible to take a screenshot of a website programmatically?

后端 未结 5 768
醉酒成梦
醉酒成梦 2021-01-02 21:49

Do you think is technically possible to take a screeshot of a website programmatically?

I would like to craft a scheduled Python task that crawls a list of websites

5条回答
  •  青春惊慌失措
    2021-01-02 22:16

    I used selenium and PhantomJS.

    from selenium import webdriver
    driver = webdriver.PhantomJS()
    driver.get("http://anyurl.com")
    driver.save_screenshot("/path/to/folder")
    

    be sure to place the PhantomJS executable in your $PATH.

提交回复
热议问题