Saturday, October 11, 2014

Using YQL to select specific information in Yahoo Pipes

YQL can be used instead of the fetch page module to select specific areas of a website. It is useful for selecting very specific elements such as the comments on a topic within a forum. It helps cut back on having to use complex regex which can be a real time saver.


To follow the steps in this tutorial you must first install firebug. Click here for help.


1. Select the YQL module from the sources area of YahooPipes


2. Paste the follow YQL query into the YQL module. Replacing the website address with your own, and the xpath with your own.


select * from html where url=’http://www.tek-9.org/news/announcing_the_powercup_on_esports_heaven-2095.html’ and xpath=’/html/body/div[5]/div[2]/div/h2′


4. Make sure there are no spaces in this query.


3. Depending on the accuracy of your YQL query you made find you have several nodes (01,2,3,4) in the debugger. You can either try to make a more specific xpath by going back to firebug (this is not always possible) or move onto the next tutorial to learn how to use the “item builder”


No comments:

Post a Comment