doubiao9775
doubiao9775
2010-01-21 12:39

有没有办法通过URL自动截取网站的屏幕截图?

已采纳

I am trying to find a PHP script (or a script in a different language) that after passing a URL, it takes a screenshot of the website for that URL. So for example if I pass stackoverflow.com, it should take a screen shot of the website (in this case the homepage), keep it on the server, and provide a link to that pic.

Is there an easy way to do that?

I know it is possible because that's how they take thumbnails for websites in Alexa for example.

If you need more explanation of what I mean please just post a comment and I will explain more.

Thank you :)

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

6条回答

  • dongmimeng5500 dongmimeng5500 11年前
    点赞 评论 复制链接分享
  • doumeinuoye81969 doumeinuoye81969 6年前

    Google page speed insight Api provide thumbnail size screenshot,

    I have coded example here (for PHP),

    https://github.com/harshadgoswami/site-screenshot

    hope it helps

    点赞 评论 复制链接分享
  • dongtuo6562 dongtuo6562 11年前

    Browsershots normally has their backend source code available, but as of this answer, it appears to be offline at the moment. There is an outdated mirror on Github which you can look at.

    点赞 评论 复制链接分享
  • douxun2018 douxun2018 11年前

    Something like Litmus?

    点赞 评论 复制链接分享
  • duanfei1987 duanfei1987 11年前

    Start a Browser (like system("firefox [url]")), run a screengrabber for that window and save the image somewhere.

    Since the output is always depending on the render engine used it is not possible by using php alone.

    Other option would be to embed a rendering engine (Gecko or similar) into your php script.

    点赞 评论 复制链接分享
  • dream3323 dream3323 11年前

    You can use browsershots.org service or litmusapp.com. Both of these will generate screenshot of a page. You can then download the screenshot and use it in a way you need to.

    点赞 评论 复制链接分享

相关推荐