Reputation: 707
I have an xpath expression which makes use of the "|"-operator to select several nodes/divs of an web page.
This is the expression:
hxs.select('//div[@class="cat"]/p|//div[@class="entry"]').extract()
But when I output the result I get a comma between the output of the first expression
//div[@class="cat"]/p
and the second
//div[@class="entry"]
Like:
'Lorem ipsum', 'Ipsum Lorem'
Is there a way to get rid of the comma?
Like:
'Lorem ipsum Ipsum lorem'
Or is there perhaps a better way to write xpath expressions which selects Both THIS div AND THIS div.
The rest of the application is written in Python, but I don't think this is relevant to the question. Any help much appreciated!
Upvotes: 1
Views: 501