Search code examples
xpathextractfeedpipeyahoo

xpath to extract all different id in yahoo pipes


I'm trying to build an rss feed from my website page by using yahoo pipes tool.

I be able to extract only one id from a web page by using "xphat fetch page" from yahoo pipes:

//*[@id="ctr3262_MainView_ViewBlog_lstBlogView_lnkEntry_0"

The others id are different: ..lstBlogView_lnkEntry_1, ..lstBlogView_lnkEntry_2 and so on.

This is a portion of html file:

< div class="vbEntry" >
< h2 >
< a id="ctr3262_MainView_ViewBlog_lstBlogView_lnkEntry_1" rel="bookmark" href="http://www.site.com/blogs/EntryId/12">word1-word2-word3 < /a >
< /h2 > 
< div class="vbHeader dnnClear" >
from < a href='http:/www.site.com/ipse dixit' > ipse dixit < /a > , 
< span id="ctr3262_MainView_ViewBlog_lstBlogView_lblPublishDate_1" >sunday 7 december 2012 17:31 < /span >
< div class="dnnRight" >< /div >
< /div >

How can I view all ID from my page?


Solution

  • If you are looking for all elements with id where id contains a text use this

    "//*[contains(@id, 'lstBlogView_lnkEntry_') ]"
    

    all elements with id:

    "//*[@id ]"
    

    all ids:
    Take the answer from @Jens Erat