dongweiben5229 2013-06-16 11:10
浏览 20
已采纳

以编程方式创建网站图像[关闭]

When I look at social bookmarking website or web master tools, they have a screenshot of a website showing.

I would like to do the same thing. How can I go about doing this? (I know they are not using iframe, but rather small thum nail size png file)

Is it possible to achieve this with javascript or do I need to use Windows or Mac OS that can take a screenshot from browser and somehow automate it?

I would like to achieve this goal with javascript or PHP, Python, Ruby. (I read somewhere that phantomjs might be able to achieve this?)

Please give teach me how I can go about with this problem.

  • 写回答

1条回答 默认 最新

  • duanmengsuo9302 2013-06-16 11:14
    关注

    You need a server side programming language that has a webkit module.

    Using that you could create a widget into a virtual display and load the site in that and get a screenshot made once it's done loading.

    I have done something like this using python, qt, qt webkit and pyqt but did not take a screenshot.

    This might help:

    http://codescience.wordpress.com/2011/04/19/very-simple-web-browser-on-pyqt4-and-webkit/

    Keep in mind that what you want is a bit different so just go to the point where you open the site in the widget and find a way to take the screenshot.

    Also look into executing the app into a virtual display.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 数学建模,尽量用matlab回答,论文格式
  • ¥15 昨天挂载了一下u盘,然后拔了
  • ¥30 win from 窗口最大最小化,控件放大缩小,闪烁问题
  • ¥20 易康econgnition精度验证
  • ¥15 msix packaging tool打包问题
  • ¥28 微信小程序开发页面布局没问题,真机调试的时候页面布局就乱了
  • ¥15 python的qt5界面
  • ¥15 无线电能传输系统MATLAB仿真问题
  • ¥50 如何用脚本实现输入法的热键设置
  • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能