Pages

YQL Page Scraping (Yes, anyone can do it)

One of the most common use of YQL is getting data from any page on the internet(page scraping/Web scraping), thats why some of the people say yql can do
"Select * from Internet"

What is YQL?
YQL or Yahoo Query Language is an expressive SQL-like language that lets you query, filter, and join data across Web services.
Every YQL statements gets translated into a URL (a REST query) which gives back the data u queried.
All data from YQL can be consumed in form of JSON or XML. Here is a demo html and JavaScript Code which is using YQL Rest API to consume data in JSON.



You can simply copy paste above code in an html file and load in browser to see its functionality. Code loads JSON from YQL via a script tag at the bottom of page. This JSON comes with a callback function named 'renderYQL', the function will render the json on your page. function renderYQL is defined above in the html (well before your json might arrive).

Play around with it change URL and XPATH to get different data from internet!

More Resources?

No comments:

Post a Comment

Your comment will inspire me, Please leave your comment