是否可以not in
在if
语句中使用多个?
for each_id in lst:
if "Audiobook" not in (driver.find_element_by_id('productDetailsTable').text) & "a-popover-root" not in (driver.page_source):
titles.append(driver.find_element_by_id('title').text)
上面的代码对我不起作用,我尝试了多种但无法弄清楚,
任何帮助表示赞赏?
您需要使用逻辑“与”( and
),而不是按位的“与”( &
):
if "Audiobook" not in (driver.find_element_by_id('productDetailsTable').text) and "a-popover-root" not in (driver.page_source):
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句