python报错<AttributeError: 'NoneType' object has no attribute 'replace'>

python报错

爬虫初学者,遇到下面这个问题要怎么解决呢?
{AttributeError: 'NoneType' object has no attribute 'replace'}

img

reference_num 的值应该是 None ,所以就报错了,你可以输出 reference_num 看下,或者打断点调试下