replace 替换字符串中的特殊符号 数据中含有逗号,需要把它去掉,代码如下: result = '45,4564' result = str.replace(result,",",'') print(result) 正则匹配数据中的数字 一开始用XPATH提取的result