XPath for accessing Flickr’s popular tags

I was finally able my parsing of my Flickr-based project to use XPath instead of iterating through nests of XML elements to get at the daily, weekly and all-time popular tags on Flickr’s most popular tags page.

These are the XPath tags for getting to the <a> elements on Flickr’s most popular tags page

// The all-time most popular tags
String xpAllTime = "//p[@id='TagCloud']/a";

// Daily (24 hours) popular tags
String xpDaily = "//table[@id='Recently']/tr/td[1]/p//a";

// Weekly popular tags
String xpWeekly = "//table[@id='Recently']/tr/td[last()]/p//a";

0 Responses to “XPath for accessing Flickr’s popular tags”



  1. No Comments Yet

Leave a Reply




Blog Stats

  • 5,003 hits

My Work Blog

This is my code blog, where I post any interesting code I develop during the course of my work. My research blog is on Blogger, and that is where I update the course of my research work at Columbia University. Blogger's source code formatting is not up to par, but Wordpress' is excellent, which is why my code is being posted on this blog.