I have fixed the previous problem. But now I face a new issue.
when I search Sheeran in the page, if "Shreeran" in j:
everything is just fine. However, if i add one more keyword like concert, the result will be generated randomly. For example; if "Shreeran" or "concert" in j:
. How can i fix it?
while True:
url ='https://xxxxxxxxx/{}'.format(pagenum)
driver.get(url)
pagesource = driver.page_source
soup = BeautifulSoup(pagesource, 'lxml')
if url == "https://xxxxxxxxxx/5":
break
else:
for s in soup.find_all("div", class_="_2cNsJna0_hV8tdMj3X6_gJ"):
for j in s:
if "Sheeran" in j: # only search Sheeran is fine but if i change it to "Sheeran" or "concert", the result will be generated randomly
print(s.text)
pagenum+=1
time.sleep(2)
how can i search somethings with multiple key words?