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 None
Traceback (most recent call last):
File "<input>", line 1, in <module>
NameError: name 'next_page' is not defined
turn is not None
True
turn
[]
if turn:
print('sss')
turn is not None
True
turn is None
False
为啥这个是空 写is not None 是对的?这个is not None 什么时候用?
慕村9548890
qq_笑_17
眼眸繁星
LEATH
鸿蒙传说
相关分类