Description
def parse_detail(self, response: HtmlResponse, item: DetailDataItem):
selectors = response.jmespath("news.body")
selectors.xpath(".//script|.//style").drop()
item.content = selectors.xpath("string(.)").get().strip()
yield item
I'm trying to remove the 'style' tag from the element using selector.xpath(".//script|.//style").drop()
. However, even after executing this line of code, the 'style' element still exists in the DOM.
Here's url:
https://newsinfo.eastmoney.com/kuaixun/v2/api/content/getnews?newsid=202406083099747443&newstype=1
Metadata
Metadata
Assignees
Labels
No labels