python - 正则如何提取标题
巴扎黑
巴扎黑 2017-04-18 10:29:03
0
1
569

通过以下代码提取标题:Deliveryfrom £3.99at Yours Clothing
请问正则怎么书写呀?跪求高手指点,谢谢!

巴扎黑
巴扎黑

reply all (1)
Ty80
>>> str_split = re.findall(r'js-click-reveal">\n([\s\S]*?)([\s\S]*?)([\s\S]*?)\n', html)[0] >>> print str_split[0].lstrip() + str_split[1] + str_split[2] Delivery from £3.99 at Yours Clothing >>>
    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template
    About us Disclaimer Sitemap
    php.cn:Public welfare online PHP training,Help PHP learners grow quickly!