News for hackers. Stuff that matters.
Re:Show HN: Apifier – hosted web crawler for developers by thecodemonkey on Tuesday October 20, 2015 @04:33PM (#10421632)
I don't quite understand why you would use a full-blown browser like phantomjs for crawling (I've seen a lot of projects recently taking this approach, so this critique is not directly towards Apifier).

Yes, I get that in some specific circumstances it would be nice to be able to execute the JavaScript on the page but think about the trade-off here.

In the vast majority of cases a simple HTTP GET request with a DOM parser is all you need -- actually not a single one of the examples on the Apifier homepage has any need for phantomjs.

Wouldn't it be much much cheaper, simpler and faster to ditch phantomjs? Or is there something I'm missing here?

Re:Show HN: Apifier – hosted web crawler for developers by jancurn on Tuesday October 20, 2015 @04:57PM (#10421767)
You're right that most of the time you don't need to use JavaScript.

But look at Google Groups for example - there is an infinite scroll to get all the topics, posts are also loaded dynamically, so you have to wait some time to get them.

In the SFO flights example you have to deal with pagination also using JavaScript.

We wanted to build a powerful tool which can crawl and scrape almost any website out there. It's slower, but you can use bench of our nodes to do it in parallel.

Re:Show HN: Apifier – hosted web crawler for developers by thecodemonkey on Wednesday October 21, 2015 @11:08AM (#10425937)
I agree that the Google Groups example is much simpler when using PhantomJS, but I would argue that it would be an outlier.

The SFO flights example is actually heavily over engineered, from quickly glancing over the XHR tab in Chrome Network tools it was pretty obvious that all of the data is actually located in this very nice JSON blob http://www.flysfo.com/flightprocessing/fullFlightData.txt

(I assume that the SF Flight Info was just meant as an example for the platform and as such the fact that it's already a JSON blob was just ignored for the sake of the example)

Re:Show HN: Apifier – hosted web crawler for developers by Eridrus on Tuesday October 20, 2015 @05:00PM (#10421782)
I've written some projects which use phantomjs; the primary motivation for me has been the desire to look at the web in general, rather than specific sites I'm scraping data off, and having the ability to see what their javascript does.
Re:Show HN: Apifier – hosted web crawler for developers by est on Tuesday October 20, 2015 @09:44PM (#10423060)
It's OK when you only have to crawl one or two websites, sure, manually analyze the js and write minimal DOM parsing routes would do.

But how about hundreds or thousands of websites to crawl? Or do you prefer just use phantomjs write static extraction rules.

Re:Show HN: Apifier – hosted web crawler for developers by pkulak on Tuesday October 20, 2015 @10:54PM (#10423404)
If you limit to just that, then there's no benefit over 10 lines of Ruby and Nokogiri.
Re:Show HN: Apifier – hosted web crawler for developers by jancurn on Tuesday October 20, 2015 @12:58PM (#10420338)
Hello HN! Today we’re launching what we were building for the past couple of months. Apifier is a hosted web crawler for developers that enables them to extract data from any website using a few simple lines of JavaScript. We built it because we realized that many existing web scrapers trade off their ability to scrape complex websites for the "simplicity" of their user interface. We thought: we are programmers and we already use JavaScript for client-side development, so why not use it for scraping?

Please have a look at the service, play with the examples and maybe set up your own crawl. My co-founder jakubbalada and myself will be around here to answer your questions. We'd love to hear what you guys think!

Re:Show HN: Apifier – hosted web crawler for developers by jacquesm on Tuesday October 20, 2015 @01:44PM (#10420602)
Do you respect robots.txt? Do you publish your IP ranges?
Re:Show HN: Apifier – hosted web crawler for developers by jakubbalada on Tuesday October 20, 2015 @01:52PM (#10420642)
Yes, by default we respect robots.txt. There is a switch to disable it - on your own responsibility. We don't fully respect Crawl-delay, but minimum delay between requests for all our crawlers is set to 2000ms. We don't publish our IP ranges yet.
Re:Show HN: Apifier – hosted web crawler for developers by rgbrgb on Tuesday October 20, 2015 @03:42PM (#10421314)
Looks really cool! Pricing is the big stickler for me. I've been burned too many times to build any critical piece of my app with it without knowing how much it'll cost if it gets popular.
Re:Show HN: Apifier – hosted web crawler for developers by jancurn on Tuesday October 20, 2015 @03:49PM (#10421360)
Many thanks! You're absolutely right, we'll publish the price ASAP and also provide some long-term guarantee for users who will depend on our service. BTW do you think pricing per GB downloaded is reasonable or would you prefer some flat monthly fee?
Re:Show HN: Apifier – hosted web crawler for developers by nsp on Tuesday October 20, 2015 @09:11PM (#10422961)
Can't speak for the OP but I'd vastly prefer either a flat fee (maybe tiered based on parallelism) or something like price per page, makes it much easier to estimate usage.
Re:Show HN: Apifier – hosted web crawler for developers by jakubbalada on Tuesday October 20, 2015 @09:31PM (#10423014)
You're right, price per request would be easier for estimation. But as you can use JavaScript, you can scrape whole website with just one page request (see the SFO flights example). In other words, our costs doesn't correlate with page requests, but with data transfer.

Flat fee is also possible, but we think that it's fair that users pay based on their consumption.

Re:Show HN: Apifier – hosted web crawler for developers by necrodome on Tuesday October 20, 2015 @07:26PM (#10422564)
How do you access the latest crawling results programmatically? I hope you are not expecting me to click results link for a developer's tool.
Re:Show HN: Apifier – hosted web crawler for developers by jakubbalada on Tuesday October 20, 2015 @07:37PM (#10422616)
Of course not, API will be available soon - in a week or two. If you have some other feature requests, please let us know, we need to help with prioritization.
Re:Show HN: Apifier – hosted web crawler for developers by danielharan on Tuesday October 20, 2015 @11:05PM (#10423438)
I'm hoping this could save me some work.

A few questions, if founders are still around:

-Can you cache pages / download entire sites? -If caching, can you detect changes on a given schedule, trigger the extraction "pageFunction" and save versioned data?

-How do you handle errors?

-Will you handle database extractions and other sites that require multiple levels of what you have as pseudo-URLs?

Re:Show HN: Apifier – hosted web crawler for developers by jancurn on Tuesday October 20, 2015 @11:37PM (#10423559)
We're still here :)

- at the moment we don't store the HTML content of the visited pages (except of the last one), so the only way to determine if something changed is to run the 'pageFunction' on each page again and compare the results. This can be optimized in certain situation, e.g. you can crawl a product listing and only go to product details page if some basic property changed. Saving HTML for each page is certainly possible, but after the crawler finished loading a page, running a pageFunction adds very little extra overheads.

- if a page cannot be loaded for any reason, a detailed description of the error will be present in the JSON results. We want to implement a limited number of retries for these pages, for situations the error is just temporary.

- certainly, if your crawling strategy cannot be expressed using simple pseudo-URLs, you can use the low-level 'interceptRequest' function to control exactly how each new page navigation request is handled (enqueued/ignored), tell the crawler which URLs refer to same pages and shouldn't be visited again etc. You can also enqueue arbitrary pages to crawl using 'context.enqueuePage'. In fact, you don't need to use pseudo-URLs at all and control everything from your code.

Re:Show HN: Apifier – hosted web crawler for developers by benjmn on Tuesday October 20, 2015 @04:11PM (#10421502)
As a website owner, is it easy to block a rude crawler by contacting you ? (How would I identify in the first place that the crawler is operated by you ? Would my server logfile have enough data to point back to you ? )

Nice & useful demo. I'll give it a try.

Re:Show HN: Apifier – hosted web crawler for developers by jancurn on Tuesday October 20, 2015 @05:20PM (#10421889)
Currently, there is no way to distinguish traffic from our crawlers, but of course, let us know at [email protected] and we will blacklist your websites from our crawlers.
Re:Show HN: Apifier – hosted web crawler for developers by Eridrus on Tuesday October 20, 2015 @04:24PM (#10421588)
Why should I use this instead of just firing up some spot instances with phantomjs?
Re:Show HN: Apifier – hosted web crawler for developers by jancurn on Tuesday October 20, 2015 @04:45PM (#10421695)
You could definitely do that, but then you might also need to:

- implement a mechanism to find and click active page elements, track the browser actions

- recompile PhantomJS to support POST requests

- implement a page queue with checks for duplicate URLs

- implement some parallelization and failover mechanism for case PhantomJS crashes (it does)

- possibly implement support for infinite scroll

- setup your own pool of proxy servers

- setup a database to store the results

and finally make the whole thing simple to setup and use :)

Re:Show HN: Apifier – hosted web crawler for developers by bentpins on Tuesday October 20, 2015 @02:18PM (#10420805)
I love the demos, and that you can use them without registering. One thing I couldn't find without making an account was what happens after you've used a Gigabyte. That would be a helpful addition I think.
Re:Show HN: Apifier – hosted web crawler for developers by jancurn on Tuesday October 20, 2015 @02:22PM (#10420825)
TBH we don't have the pricing defined yet, because we don't know what will be our server costs. In a few days we will know more and put up the prices.
Re:Show HN: Apifier – hosted web crawler for developers by jancurn on Tuesday October 20, 2015 @02:24PM (#10420840)
I forgot to add: when you reach 1 GB we'll get in touch with you.
Re:Show HN: Apifier – hosted web crawler for developers by aakilfernandes on Tuesday October 20, 2015 @02:37PM (#10420909)
Cool! How do you stop users from trying to run malicious code?
Re:Show HN: Apifier – hosted web crawler for developers by jancurn on Tuesday October 20, 2015 @02:45PM (#10420956)
Thank you! The user JavaScript code runs in the context of the web pages in the same restricted environment as normal web page's JavaScript. Also, the crawling processes are sandboxed.
Re:Show HN: Apifier – hosted web crawler for developers by thomasfromcdnjs on Tuesday October 20, 2015 @07:30PM (#10422588)
Also similar to https://morph.io/ which has more of a trend towards open data sets.
Re:Show HN: Apifier – hosted web crawler for developers by jancurn on Tuesday October 20, 2015 @07:56PM (#10422699)
morph.io is a great tool but it requires a non-trivial setup on your machine in order to get things running. We wanted to enable people to create scrapers with no prerequisites.
Re:Show HN: Apifier – hosted web crawler for developers by misiti3780 on Tuesday October 20, 2015 @01:59PM (#10420691)
I like the idea - would probably use it in the future - can you talk a little bit about what technologies you are using?
Re:Show HN: Apifier – hosted web crawler for developers by jancurn on Tuesday October 20, 2015 @02:07PM (#10420745)
Thank you! The crawler is currently based on PhantomJS, there is a pool of worker nodes that distribute the crawling to more machines. We use Node.js + MongoDB backend and Meteor for front-end.
Re:Show HN: Apifier – hosted web crawler for developers by asterfield on Tuesday October 20, 2015 @05:15PM (#10421859)
I was just thinking yesterday of creating a similar service. I'm glad to see someone else has already made it :D
Re:Show HN: Apifier – hosted web crawler for developers by jancurn on Tuesday October 20, 2015 @05:19PM (#10421876)
Cool, if things go well, we'll be hiring soon :)
Re:Show HN: Apifier – hosted web crawler for developers by Raphmedia on Tuesday October 20, 2015 @01:59PM (#10420695)
Exactly what I was looking for in order to efficiently improve my searches for a new home. Thanks!
Re:Show HN: Apifier – hosted web crawler for developers by rgbrgb on Tuesday October 20, 2015 @03:40PM (#10421297)
Raph, awesome that you're hacking your own tools for homebuying! This is how our company started.

If you're looking in California, let us know if there's a feature we could add to Open Listings to improve your search. Always excited to help HNers hack homebuying. One thing we're adding soon is the ability to filter your property feed by running regular expressions over the descriptions. We'd love to hear other ideas for hacker friendly homebuying :).

Re:Show HN: Apifier – hosted web crawler for developers by jancurn on Tuesday October 20, 2015 @02:57PM (#10421037)
Great to hear that, let us know if we can help in any way!