python怎么用正则怎么获取标题
大家讲道理
大家讲道理 2016-11-12 11:06:23
0
3
816
大家讲道理
大家讲道理

光阴似箭催人老,日月如移越少年。

Antworte allen (1)
阿神

反向思维, 从标签中找到文本很麻烦, 所以我们干脆就把别的标签都干掉

import re html = u'

$300 Off Phantom 3 Standard

'title = re.sub(ur'<.+?>', '', html).strip()print title # $300 Off Phantom 3 Standard


    Neueste Downloads
    Mehr>
    Web-Effekte
    Quellcode der Website
    Website-Materialien
    Frontend-Vorlage
    Über uns Haftungsausschluss Sitemap
    Chinesische PHP-Website:Online-PHP-Schulung für das Gemeinwohl,Helfen Sie PHP-Lernenden, sich schnell weiterzuentwickeln!