Regex for links in html text

前端 未结 8 1664
旧巷少年郎
旧巷少年郎 2020-12-16 04:42

I hope this question is not a RTFM one. I am trying to write a Python script that extracts links from a standard HTML webpage (the tags). I hav

8条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-16 05:40

    It depends a bit on how the HTML is produced. If it's somewhat controlled you can get away with:

    re.findall(r'''''', html, re.I)
    

提交回复
热议问题