[SOLVED] Xpath syntax help for extract information process

Unknown
edited November 5 in Community Q&A
Hello everyone,
Very new to Rapid Miner, but really excited about what it can do. I've got a question about Xpath syntax, I'm trying to grab the H1 of class 'mainbox-titile' (it's the product name, "ADORA SANDAL - 238523") from http://www.eccocanada.com/adora-sandal-238523.html. I've tried various different versions of //h:*[@class='mainbox-title']/h:h1/text(), but I can't seem to get it right. Any tips would be greatly appreciated...

Thanks,
Tagged:

Answers

  • Skirzynski
    Skirzynski New Altair Community Member
    Hey,

    You want to grab the the h1 tag with the class 'mainbox-title', but your XPath says that you want any tag with the class 'mainbox-title' which contains a h1 tag. So your path finds the h1 tag, looks inside, does not find another h1 tag within the h1 tag, and thus, returns nothing.

    So, the correct path for the title is:

    //h:h1[@class='mainbox-title']/text()
  • Works like a charm! Thanks for the help and apologies for the slow reply...