4 ms·
For those of us on the outside, what's the typical use cases of a headless browser engine? Testing?
by acron0 13y ago
For those of us on the outside, what's the typical use cases of a headless browser engine? Testing?
- deleted 13y ago[deleted]
- tlarkworthy 13y agoangularjs 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/html-snapshot https://developers.google.com/webmasters/ajax-crawling/docs/...)
- rjh29 13y agoI would be surprised if Google was not doing this themselves to some extent.
- akmiller 13y agoThey are not (although they definitely should be). Google will read and index javascript, they do not execute it.
- yahelc 13y agoThere's some evidence that they are. [1] http://searchengineland.com/google-can-now-execute-ajax-javascript-for-indexing-99518 http://searchengineland.com/google-can-now-execute-ajax-java... [2] http://www.seomoz.org/ugc/can-google-really-access-content-in-javascript-really http://www.seomoz.org/ugc/can-google-really-access-content-i...
- saryant 13y agoI 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 http://akka.io
- juanriaza 13y agoAnd web scraping
- meerita 13y agoWe 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.
- DenisM 13y agoCan you capture PDF that way, or is it only png?
- meerita 13y agoTo 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.
- DenisM 13y agoPrinting 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.
- j_s 13y agohttp://code.google.com/p/wkhtmltopdf/ http://code.google.com/p/wkhtmltopdf/ hasn't gotten much love lately, but it could still work for you.
- acron0 13y agoI 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?
- meerita 13y ago
- elmomalmo 13y agoRunning JavaScript unit tests headlessly in CI.
- yashodhan 13y agoI 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.
- justincormack 13y agoAll 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....