【发布时间】:2014-06-21 19:55:33
【问题描述】:
我正在使用带有产品列表的 Scrapy 抓取网站。我想要做的是使用正则表达式从产品标题字符串中删除不需要的单词。我想删除 2 个不同的重复词:Pen 和 Graphite Pencil,只刮掉品牌名称。
有什么建议吗?
<a name=“this-link”> href=“some url here”>Pen Bic Crystal</a>
some divs and other DOM structure
<a name=“this-link”> href=“some url here”>Graphite Pencil Kohinoor Carpenter</a>
some divs and other DOM structure
<a name=“this-link”> href=“some url here”>Pen Parker Jotter</a>
some divs and other DOM structure
<a name=“this-link”> href=“some url here”>Pen Bic Other Model</a>
some divs and other DOM structure
<a name=“this-link”> href=“some url here”>Graphite Pencil Palomino Blackwing Pearl</a>
【问题讨论】:
标签: python html regex web-scraping scrapy