Exclude certain elements with an xpath query -
i'm using xpath extract elements following url:
http://gizmodo.com/how-often-cities-appear-in-books-from-the-past-200-year-1040700553
to extract main content, i'm using query:
//p[@class='has-media media-640']
however, i'd exclude spans within main content have class "magnifier lightbox". i've looked through stackoverflow , tried sorts of methods such as:
//div[@class='row post-content']/*[not(self::span[@class='magnifier lightbox'])]
to no avail.
Comments
Post a Comment