title: Write Data from Multiple Site to JSON File BeautifulSoup
body: <p>I am trying to scrape multiple websites that have the same HTML structure and write the content to a JSON file.  The results for each URL print out in the terminal, but only the content from the last URL listed is written into the JSON file.  I have not been able to figure out a solution.  Here is my code </p>
  
  <pre><code>from urllib.request import urlopen
  from bs4 import BeautifulSoup as soup
  import json
  
  urls = ['https://scholarworks.gvsu.edu/books/', 'https://pdxscholar.library.pdx.edu/pdxopen/', 'https://oer.galileo.usg.edu/all-textbooks/index.html', 'https://oer.galileo.usg.edu/all-textbooks/index.2.html', 'https://digitalcommons.trinity.edu/textbooks/']
  
  #scrape elements
  for url in urls:
      uClient = urlopen(url)
      page_html = uClient.read()
      uClient.close()
  
      page_soup = soup(page_html, "html.parser")
      containers = page_soup.findAll("div",{"class":"content_block"})
      source = page_soup.find("div",{"id":"series-header"})
  
      data = []
          for container in containers:
          item = {}
          item['type'] = "Textbook"
          item['title'] = container.h2.text
          item['author'] = container.p.text
          item['link'] = container.a["href"]
          item['source'] = source.h2.text
          data.append(item) # add the item to the list
          print(container.h2.text)
  
  with open("./json/multiple.json", "w") as writeJSON:
     json.dump(data, writeJSON, ensure_ascii=False)
  </code></pre>