I need some help with removing the text in links while extracting overall texts, while getting the comments from product
scrapy shell "https://www.amazon.com/Bond-Touch-Bracelets-Long-Distance-Lovers/dp/B07VBP4R7F/ref=zg_bs_electronics_49?_encoding=UTF8&psc=1&refRID=1167P05RGXTPJ40CAX5B" #Terminal
my_str = ""
ind=1
for i in response.xpath('//*[@id="cm-cr-dp-review-list"]/div'):
c=i.xpath('.//*[@data-hook="review-body"]//text()').extract()
d=[i.strip() for i in c if i.strip()]
my_str += f"{ind}) {' '.join(d)}\n"
ind+=1
print(my_str)
my code works so far, but if there is a link in the comment I am getting it as well (which I do not want),how can I edit my XPath so it skips the texts in a
tag
I checked some of the answers on Removing markup links in text and it's using regex to do it which didn't work here.