News for hackers. Stuff that matters.
Re:Phantompy - Headless WebKit engine for Python, like phant... by acron0 on Tuesday May 21, 2013 @05:06AM (#5742564)
For those of us on the outside, what's the typical use cases of a headless browser engine? Testing?
Re:Phantompy - Headless WebKit engine for Python, like phant... by meerita on Tuesday May 21, 2013 @05:08AM (#5742570)
We use it to generate images from a website. We do a product with HTML5/CSS3 and webfonts, layout it all then "screenshooting it" to make a final image with the proportions we want. It's cool because its server side and we can generate endless images based on what the user want.

Addendum: If you want to use webfonts, specially from Google, you need to recompile Phantom to support WOFF.

Re:Phantompy - Headless WebKit engine for Python, like phant... by acron0 on Tuesday May 21, 2013 @05:09AM (#5742573)
I was going to ask about off-screen rendering. What kind of speeds are achievable? 30fps? Could I use this to stream a web texture into a game?
Re:Phantompy - Headless WebKit engine for Python, like phant... by meerita on Tuesday May 21, 2013 @06:10AM (#5742749)
It is not fast as we wished. The whole request and image deliver is about 2 seconds or more, It's because we're using right now the same server for everything but for what are you asking, I think is not good idea. Achieve 30fps i see it hard.
Re:Phantompy - Headless WebKit engine for Python, like phant... by DenisM on Tuesday May 21, 2013 @11:43AM (#5744427)
Can you capture PDF that way, or is it only png?
Re:Phantompy - Headless WebKit engine for Python, like phant... by j_s on Tuesday May 21, 2013 @01:53PM (#5745411)
http://code.google.com/p/wkhtmltopdf/ hasn't gotten much love lately, but it could still work for you.
Re:Phantompy - Headless WebKit engine for Python, like phant... by meerita on Tuesday May 21, 2013 @12:47PM (#5744899)
To do PDF, you better install HTML->PDF command line tool than that. What this do is simply load a webkit browser and we just perform an screen of that.
Re:Phantompy - Headless WebKit engine for Python, like phant... by DenisM on Tuesday May 21, 2013 @02:25PM (#5745672)
Printing works differently in different engines, so I want the designer to use her HTML / chrome skills to design templates, and then render the PDF with users data using the same engine. Command line HTML to PDF tool will work too, but it will require the designer to relearn engine quirks.
Re:Phantompy - Headless WebKit engine for Python, like phant... by yashodhan on Tuesday May 21, 2013 @05:15AM (#5742588)
I use phantomjs to login to my bank's website and grab my balance for me.

Unfortunately my bank decided to outsource their web operation to the cheapest bidder from India and as a result their web application is beyond shit. It requires javascript to work, and therefore I needed a headless broswer engine to scrape it.

Re:Phantompy - Headless WebKit engine for Python, like phant... by justincormack on Tuesday May 21, 2013 @09:24AM (#5743443)
All the banks I have used in the last 10 years have required hardware tokens. Recommend you change banks even if that makes screen scraping your balance impossible....
Re:Phantompy - Headless WebKit engine for Python, like phant... by atlbeer on Tuesday May 21, 2013 @11:40AM (#5744407)
Two factor auth is extremely uncommon in the US for banking.

My UK account uses 2 factor but, none of the financial sites I use in the US (4 different companies) have it.

Re:Phantompy - Headless WebKit engine for Python, like phant... by atlbeer on Tuesday May 21, 2013 @11:41AM (#5744419)
Just to add though. Wire transfers require txt or call authentication.
Re:Phantompy - Headless WebKit engine for Python, like phant... by saryant on Tuesday May 21, 2013 @02:08PM (#5745509)
I recently built a service using PhantomJS for a client. They have graphs and charts generated with d3.js that they wanted to add to their user-specific update emails.

I built a backend service using Akka[1] and PhantomJS which would grab the appropriate user's page, render it to HTML, splice up the images and save everything to temp files. Then I had a Java process that read those back in then format and sent an email to the user.

[1]: http://akka.io

Re:Phantompy - Headless WebKit engine for Python, like phant... by tlarkworthy on Tuesday May 21, 2013 @07:27AM (#5742949)
angularjs and other JS rendering techniques make the plain HTML look a mess. Google will not be able to present the page or get its content properly, so you use something like this to take snapshots of your website post rendering and expose it for indexing & website previews. (https://developers.google.com/webmasters/ajax-crawling/docs/...)
Re:Phantompy - Headless WebKit engine for Python, like phant... by rjh29 on Tuesday May 21, 2013 @07:33AM (#5742959)
I would be surprised if Google was not doing this themselves to some extent.
Re:Phantompy - Headless WebKit engine for Python, like phant... by yahelc on Tuesday May 21, 2013 @09:43AM (#5743558)
Re:Phantompy - Headless WebKit engine for Python, like phant... by akmiller on Tuesday May 21, 2013 @09:38AM (#5743535)
They are not (although they definitely should be). Google will read and index javascript, they do not execute it.
Re:Phantompy - Headless WebKit engine for Python, like phant... by elmomalmo on Tuesday May 21, 2013 @05:14AM (#5742584)
Running JavaScript unit tests headlessly in CI.
Re:Phantompy - Headless WebKit engine for Python, like phant... by juanriaza on Tuesday May 21, 2013 @05:08AM (#5742568)
And web scraping