像这个问题中,我想利用selenium中的css单独提取1和1722455,提取出来split分割不了

html-css08

像这个问题中,我想利用selenium中的css单独提取1和1722455,提取出来split分割不了,第1张

new_string = search_result_string.split('约')[1] # 第一次切割得到 xxxx个,[1]代表切割右边部分

print (new_string)

last_result = new_string.split('个')[0] # 第二次切割,得到我们想要的数字 [0]代表切割参照参数的左边部分

print (last_result)

方法很多:

1.最渣的方法:图片

2.第二渣的方法:3个标签:1)外框用来posotion:relative2)文字有背景色;3)就是那条线,原理就是文字用定位浮起来然后加上背景色遮住线,造成这种效果;

3.我推荐的方法:

html:

<fieldset>

<legend  align='center'>健康日志</legend>

</fieldset>

css:

fieldset{

border: none

border-top: 1px solid #ccc

}

html标签,兼容所有浏览器。。。谁用谁知道