How to scrap text included between various tags using scrapy

后端 未结 1 1408
暗喜
暗喜 2021-01-03 12:42

I am trying to scrap product description from this link. But how do i scrap the whole text including text between tags. Here is the hxs object hxs.select(\'/

1条回答
  •  -上瘾入骨i
    2021-01-03 13:30

    Try taking whole content from tag with

     //div[@class="overview"]/div
    

    and then you can remove tags from it with regex or leave them if they are not a problem.

    Something like this regex:

     re.sub('<[^>]*>', '', mystring)
    

    0 讨论(0)
提交回复
热议问题