Render web page with Go?

1,296 views
Skip to first unread message

nvcnvn

unread,
Mar 29, 2014, 10:56:09 AM3/29/14
to golan...@googlegroups.com
I want to build an app that recieve an URL of a website using AngularJS for example, and return the final DOM result.
Do you know what options I have or only the WebKit binding?

Thanks!

Henrik Johansson

unread,
Mar 29, 2014, 11:20:14 AM3/29/14
to nvcnvn, golang-nuts

I think angularjs works differently. Leave the DOM alone and feed it some json.

This is super easy in Go and there are numerous add-ons if the standard library is not enough.

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

nvcnvn

unread,
Mar 29, 2014, 11:28:27 AM3/29/14
to golan...@googlegroups.com, nvcnvn
I think you miss understood me.
What I want is something like http://phantomjs.org/ but more simple and can handle by Go. Be simple: I want a browser in Go.
Go already has some webkit binding I belive, but I'm not sure is there any other option (Geko binding or ...mmaybe).

Sorry for my English

Job van der Zwan

unread,
Mar 29, 2014, 1:37:28 PM3/29/14
to golan...@googlegroups.com, nvcnvn

Job van der Zwan

unread,
Mar 29, 2014, 1:40:04 PM3/29/14
to golan...@googlegroups.com, nvcnvn
http://qt-project.org/doc/qt-4.7/demos-declarative-webbrowser.html

(it's probably obvious I have no experience with this myself)

Peter Nguyen

unread,
Mar 30, 2014, 3:49:33 AM3/30/14
to golan...@googlegroups.com
What you want is Webloop (https://github.com/sourcegraph/webloop) You can use it to crawl an AngularJS app and get back the static HTML.

nvcnvn

unread,
Mar 30, 2014, 7:23:24 AM3/30/14
to golan...@googlegroups.com
I think both Go QML and Webloop required some GUI libary installed (Qt/gtk).
Can they run on GAE?

Anyway since all what I want to get the renderd HTML and save it somewhere, so I think it would be nice if I can avoid GUI libary (if possible).

Henrik Johansson

unread,
Mar 30, 2014, 3:35:12 PM3/30/14
to nvcnvn, golang-nuts
Do you want a browser that can render a web page as a viewable image with all javascript and what not embedded?
Not sure how you could do that without using some sort of gui kit or at least an impressive set of libraries for lots of stuff.


--

Nguyên Nguyễn Văn Cao

unread,
Mar 30, 2014, 10:31:57 PM3/30/14
to Henrik Johansson, golang-nuts
What I want is just the renders DOM as a string so I can save it in my database or filesystem, not to display and view.


--
Nguyễn Văn Cao Nguyên
    /**
     * Contact : +84+935704595
     * Blog      :  http://nguyen.open-vn.org
     */

Hai Thanh Nguyen

unread,
Mar 31, 2014, 11:47:30 AM3/31/14
to golan...@googlegroups.com
Long answer: It's difficult to do this thing on GAE, cgo doesn't work, so everything must be in pure go. I've never heard of a js-enabled web renderer in Go. We have a pure go javascript intepreter already (https://github.com/robertkrimen/otto), but there is a big gap between interpreting the scripts and actually getting the rendered page, it would be a big project.
Short answer: not available AFAIK.

Nguyên Nguyễn Văn Cao

unread,
Mar 31, 2014, 12:11:59 PM3/31/14
to Hai Thanh Nguyen, golang-nuts
Yes, that what I think, a webkit wrapper on a self-host server is the only option... just for now, I hope!


--
You received this message because you are subscribed to a topic in the Google Groups "golang-nuts" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/golang-nuts/DV-Qpa8Ffsc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to golang-nuts...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Kyle Lemons

unread,
Mar 31, 2014, 4:47:22 PM3/31/14
to Hai Thanh Nguyen, golang-nuts
A Trusted Tester for VM Runtimes has been running for awhile now:

I'm not sure what the status is, but my understanding is that this would run your instances in a VM, so you could potentially use cgo or imagemagick or whatever you wanted.  There were demos of this at GCP Live last week as well:


--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages