re表达式匹配html中的值

2019-08-27  本文已影响0人  king2king

案例1

html = '<input type="hidden" id="UserName" value="242320">'
pattern = r'<input type="hidden" id="UserName" value="(*?.)">'
result = re.findall(pattern, html)
import re
if __name__ == '__main__':
   html = '<input type="hidden" id="UserName" value="242320">'
   pattern = r'<input type="hidden" id="UserName" value="(.*?)">'
   result = re.findall(pattern, html)
   print(result)
上一篇下一篇

猜你喜欢

热点阅读