main_window = driver.current_window_handle
#open the link in a new tab
clickable_element.send_keys(Keys.CONTROL + Keys.RETURN)
#switch to that tab
driver.find_element_by_tag_name('body').send_keys(Keys.CONTROL + Keys.TAB)
driver.switch_to_window(main_window)
#close the tab
driver.find_element_by_tag_name('body').send_keys(Keys.CONTROL + 'w')
driver.switch_to_window(main_window)
//div[@itemprop="recipe-ing"]/li[@class="cat"]/span/@name
spans = soup.find_all('span', attrs={"itemprop": "name"})
for span in spans:
print(span.get_text())
lists = soup.find_all("li","cat")
for li in lists:
spans = li.find_all(attrs={"itemprop": "name"})
for span in spans:
print(span.get_text())