title: BeautifulSoup - trying to parse website but unsure how to parse json script?
body: <p>As a fun side project I have been trying to parse a website for a random fact of the day.
  I decided to try my hand at this today with BeautifulSoup4 and urllib3. Sadly however I am unsure how to dive any deeper into a script element than I already have gotten.</p>
  
  <p>This is my current level of output:</p>
  
  <pre><code>{
  "@context": "http://schema.org",
  "@type": "Article",
  "headline": "Fact of the Day: 51 Facts Of the Day for 3/19/2019 ←FACTSlides→",
  "image": "https://www.FACTSlides.com/imgs/ishots/8224.png",
  "author": "Luke Reiner",
  "genre": "facts",
  "publisher": {
      "@type": "Organization",
      "name": "FACTSlides",
      "logo": {
          "@type": "ImageObject",
          "url": "https:\/\/www.factslides.com\/imgs\/logo.png"
      }
  },
  "url": "https://www.factslides.com/s-Fact-Of-The-Day",
  "mainEntityOfPage": "https://www.factslides.com/s-Fact-Of-The-Day",
  "datePublished": "2019-03-19",
  "dateCreated": "2019-03-19",
  "dateModified": "2019-03-19",
  "description": "Description.",
  "articleBody": "Article clutter here."
  }
  </code></pre>
  
  <p>The facts themselves are stored under the <code>articleBody</code> and are not delimited, I was going to use '. ' as the Delimiter if I got that far.</p>
  
  <p>This is the code I have so far:</p>
  
  <pre><code>""" Get a random fact. """
  import argparse
  import json
  import urllib3
  from bs4 import BeautifulSoup
  
  PARAMETERS = {
      "u": ["url", "passes in a url.", "1"],
  }
  
  PARSER = argparse.ArgumentParser(
      description="Arguments to parse a url."
  )
  
  HTTP = urllib3.PoolManager()
  
  
  def __load_args(parser, cfg_list):
      """ Loads the passed arguments. """
      for cfg_key in cfg_list:
          if len(cfg_list[cfg_key]) &gt; 3:
              parser.add_argument(
                  "-" + cfg_key,
                  "--" + cfg_list[cfg_key][0],
                  help=cfg_list[cfg_key][1],
                  action=cfg_list[cfg_key][2],
                  nargs=cfg_list[cfg_key][3],
              )
          else:
              parser.add_argument(
                  "-" + cfg_key,
                  "--" + cfg_list[cfg_key][0],
                  default=None,
                  help=cfg_list[cfg_key][1],
              )
  
  
  def parse_args(parser, section_list=[]):
      """ Parses the loaded arguments. """
      for section in section_list:
          __load_args(parser, section)
      return parser.parse_args()
  
  
  ARGS = parse_args(PARSER, [PARAMETERS])
  
  RESPONSE = HTTP.request('GET', ARGS.url)
  
  SOUP = BeautifulSoup(RESPONSE.data, features="html.parser")
  
  SOUP_SCRIPT = SOUP.find_all("script")
  
  JS_TEXT = SOUP.find('script', type='application/ld+json').text
  
  print(JS_TEXT)
  </code></pre>
  
  <p>Any help would be appreciated.</p>
  
  <p>NOTE: The url I was parsing for the facts is <a href="https://www.factslides.com/s-Fact-Of-The-Day" rel="nofollow noreferrer">here</a>.</p>