from splinter import Browserfrom bs4 import BeautifulSoup as soupbrowser = Browser('chrome')url = 'https://static.bc-edx.com/data/web/mars_news/index.html'browser.visit(url)html = browser.htmlsoup = soup(html, 'html.parser')text_info = soup.find_all(class_ = "list_text")content_list = []For each in text_info: <-- Error occurs here # Extract the title content_title = each.find(class_ = "content-title").text.strip() # Extract the preview text preview_text = each.find(class_ = "article_teaser_body").text.strip() # Store each title and preview pair in a dictionary content_dict = {"title": content_title,"preview": preview_text } # Add the dictionary to the list content_list.append(content_dict)ERROR:
Cell In[8], line 5 For each in text_info: ^SyntaxError: invalid syntaxAny help explaining this error or any advice on how to fix this issue would be much appreciated!