[SOLVED] Xpath syntax help for extract information process

pjdoubleyoupjdoubleyou Member Posts: 6 Contributor II
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,

Answers

  • SkirzynskiSkirzynski Member Posts: 164 Maven
    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()
  • pjdoubleyoupjdoubleyou Member Posts: 6 Contributor II
    Works like a charm! Thanks for the help and apologies for the slow reply...
Sign In or Register to comment.