Here is what I managed to do:
from scrapy.selector import Selector sel = Selector(text = html_string) for node in sel.css('a *::text'): print node.extract()
Assuming html_string is a variable containing html in your question, this code produces the following output:
text in a text in b text in c text in b text in a text in c
The a *::text() selector matches all text nodes that are descendants of a .
source share