res=requests.get('https://www.zhipin.com/gongsi/_zzz_c101010100_iy100014_t801_s301/',headers=headers) turn=etree.HTML(res.text).xpath('//div[@class="page"]/a[contains(@ka,"page-next")]/@href') turn [] next_page is not NoneTraceback (most recent call last): File "<input>", line 1, in <module> NameError: name 'next_page' is not defined turn is not NoneTrueturn []if turn: print('sss') turn is not NoneTrueturn is NoneFalse为啥这个是空 写is not None 是对的?这个is not None 什么时候用?
胡说叔叔
相关分类