Rendering a web page with CSS

xuanbao · · 422 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>I&#39;m trying to render a full page with the CSS calculated. In Java it looks like they have <a href="http://cssbox.sourceforge.net/">cssbox</a>. I assume there are some bindings for the webkit? I don&#39;t have a huge need to process javascript, it&#39;d be nice but wasn&#39;t a requirement. I need to be able to calculate above the fold content.</p> <p>Thank you</p> <hr/>**评论:**<br/><br/>beeker1121: <pre><p>afaik there&#39;s two options:</p> <ol> <li><p>Probably the best option is using the Go driver for Selenium. Selenium is a web testing platform that uses an actual browser installed on the machine (Chrome, Firefox, etc) to run whatever you want. <a href="https://github.com/sourcegraph/go-selenium" rel="nofollow">https://github.com/sourcegraph/go-selenium</a></p></li> <li><p>PhantomJS. This is a headless browser that can process JavaScript, however, while it is a lot faster than Selenium (just from my testing), it gets blocked a lot more by websites due to incomplete support for various things an actual browser does support (i.e. a proper UserAgent string is one minor one). For this, I&#39;m not sure what the best driver would be: <a href="https://github.com/urturn/go-phantomjs" rel="nofollow">https://github.com/urturn/go-phantomjs</a> or <a href="https://github.com/k4s/phantomgo" rel="nofollow">https://github.com/k4s/phantomgo</a> and this shows how to run PhantomJS as a standalone from Go <a href="https://github.com/ilpaijin/playing-with-golang-phantomjs" rel="nofollow">https://github.com/ilpaijin/playing-with-golang-phantomjs</a>.</p></li> </ol></pre>Yojihito: <pre><p>Be aware that <a href="https://github.com/urturn/go-phantomjs" rel="nofollow">https://github.com/urturn/go-phantomjs</a> can only handle 1 line of javascript, I couldn&#39;t get my 50 loc js-script to run via Go.</p></pre>matart: <pre><p>What is your question?</p></pre>

入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889

422 次点击  
加入收藏 微博
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传