Extract string from HTML String

后端 未结 5 735
名媛妹妹
名媛妹妹 2021-01-26 04:26

i want to extract a number from a html string (i usually do not know the number).

The crucial part looks like this:



        
5条回答
  •  情书的邮戳
    2021-01-26 05:21

    You can try the following like this below:

        line = "TOTAL : 286"
        if line.startswith('TOTAL : '):
            print(line[8:len(line)])
    

    Output :

        286
    

提交回复
热议问题