I am new to beautiful soup, and I'm trying to find a way to search if an element exists within the script tag, but I keep getting not found when it's clearly there. Can you please help me with what's wrong with my line of code.
mykeyword = [element.text for element in soup.find_all("script")]
s = [element.find('cookie.indexOf') for element in mykeyword ]
if 'cookie.indexOf' in s:
print('exist')
else:
print('not found')
Thanks
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…