Skip to content Skip to sidebar Skip to footer

Extract Text With Bold Content From Css Selector

I am trying to extract a text from forum posts, however the bold element is ignored. How can I extract raw data like Some text to extract bold content? Currently I am getting only

Solution 1:

You need a space in your css selector:

'blockquote ::text'
           ^

Because you want text of every descending node under blockquote, without space it means just the text of blockquote node.

Solution 2:

Use * selector to select text of all inner elements inside an element.

''.join([ a.strip() for a in quote.css('blockquote *::text').extract() ])

Post a Comment for "Extract Text With Bold Content From Css Selector"