所以我试图从
<a href="/define.php?term=dubstep&defid=5175360">dubstep</a> the music that is created from transformers having s$#
所以在解析后读起来是这样的
dubstep - the music that is created from transformers having S$#
我想从这个html超链接中提取文本dubstep
我该怎么做呢?你知道吗
我在这里读了答案 How to remove tags from a string in python using regular expressions? (NOT in HTML)
但我明白了
<class 'NameError'>, NameError("name 're' is not defined",), <traceback object at 0x036A41E8>)
使用此选项:
为什么不使用
BeautifulSoup
?你知道吗编辑:
或者如果你只想发短信:
好吧
意思是你一开始忘了
import re
,但这只是猜测。你知道吗此外,由于您只需要
<a></a>
标记之间的单词,因此您需要一个类似于以下内容的regexp:相关问题 更多 >
编程相关推荐