Recently introduced a new extraction technique called Magic. The Magic scraping method works be attempting to scrape all the information off the page automatically and in one shot. We covered it in another post early last year. When we covered it back then, we noted a few issues:

  • The scraper only works on pages with more than one row of data like a search results page, category pages and etc.
  • It seems to have trouble with some javascript pages.

But now has released a second version of Magic which seems to have dealt with those obstacles. Not only that, but they have released an API for Magic that lets you see what’s going on behind the scenes.

How to form the magic request based on the api_key

After a few attempts and some help from’s support, I figured out how to form the request to the magic API. I recommend using the php url signing code – it helped me quite a bit.

Leverage regionText for selecting the region (table) to process using a keyword contained within it

The basic Magic (that most people use) only extracts data from what is thinks is the most important list of data on the page. But, suppose I want data from a table that isn’t in the main part of the site. Let’s take the LondonStock web page. To locate a table I use the regionText parameter to process the area that contains a certain phrase. For more on how to use regionText see the docs here. In this example, the regionText phrase would be “ftse 350 share”:


So here there is the final code for magic method:

Do not forget to urlencode() the regionText parameter and other request parameters.
The signMagic procedure has returned this API url:
And for his API url I was able to get this result; online:


Javascript and infinite scroll

The other extras in the Magic are javascript and infinite scroll support, both in beta. I’ll be covering more about these features in a later post.


If you want to use Magic without the API docs, you can install their Magic bookmark. It functions as a JavaScript code fetching the current URL content and applying Magic extraction to it.

Stay in touch for new magic.