title: How to scrape data from JSON/Javascript of web page?
body: <p>I'm new to Python, just get started with it today.<br>
  My system environment are <code>Python 3.5</code> with some libraries on <code>Windows10</code>.</p>
  
  <p>I want to extract football player data from site below as CSV file.</p>
  
  <p><strong>Problem</strong>: I can not extract data from <code>soup.find_all('script')[17]</code> to my expected CSV format. How to extract those data as I want ?</p>
  
  <p>My code is shown as below.</p>
  
  <pre><code>from bs4 import BeautifulSoup
  import re
  from urllib.request import Request, urlopen
  
  req = Request('http://www.futhead.com/squad-building-challenges/squads/343', headers={'User-Agent': 'Mozilla/5.0'})
  webpage = urlopen(req).read()
  soup = BeautifulSoup(webpage,'html.parser') #not sure if i need to use lxml
  soup.find_all('script')[17] #My target data is in 17th
  </code></pre>
  
  <p>My expected output would be similar to this</p>
  
  <pre><code>position,slot_position,slug
  ST,ST,paulo-henrique
  LM,LM,mugdat-celik
  </code></pre>