Scrapy xpath writing regex for unknown depth

I have an html file which is like :

<div id='author'> 

             <a> John Doe </a>

I do not know how many div’s would be under the author div. It may have different depth for different pages.
So what would be the regex for this kind of xml?

By the way, I tried:

'//div[@id = "author"]/*/a/text()'

but this only seems to work for grandchildren of the author div.

Source: regex

Leave a Reply