title: BeautifulSoup scrape itemprop="name" in Python
body: <p>I have some python 3.5 code that I want to scrape part of a web page with but instead of printing "Thick and Chewy Peanut Butter Chocolate Chip Bars" it prints "None". Do you know why? Thanks. </p>
  
  <pre><code>import requests, bs4
  import tkinter as tk
  from tkinter import *
  import pymysql
  import pymysql.cursors
  
  res = requests.get("http://www.foodnetwork.co.uk/article/traybake-recipes/thick-and-chewy-peanut-butter-chocolate-chip-bars/list-page-2.html")
  res.raise_for_status()
  recipeSoup = bs4.BeautifulSoup(res.text, "html.parser")
  type(recipeSoup)
  instructions = recipeSoup.find("div", itemprop="name")
  try:
      method = str.replace(instructions.get_text(strip=True),". ",".")
      method = str.replace(method, ". ", ".")
      method = (str.replace(method, ".",".\n"))
  except AttributeError:
      print(instructions)
  </code></pre>
  
  <p><a href="http://www.foodnetwork.co.uk/article/traybake-recipes/thick-and-chewy-peanut-butter-chocolate-chip-bars/list-page-2.html" rel="noreferrer">Link to scraped page</a></p>