Scraping dynamic website to get elements in <script tag> using BeautifulSoup and Selenium
<p>I am trying to scrape a dynamic website by using beautifulsoup and selenium. The attributes I would like to filter and put into a CSV are contained within a <code>&lt;script&gt;</code> tag. I would like to extract contained in </p>

<p>Script:
    
    window.IS24 = window.IS24 || {};
    IS24.ssoAppName = "search";
    IS24.applicationContext = "/Suche/error-reporter";
    IS24.ab = {};
    IS24.feature = {"SEARCH_BY_TELEKOM_SPEED_ENABLED":true,
    IS24.resultList = {
      angularDebugInfoEnabled: false,
      navigationBarUrl: "/Suche/S-T/Haus-Kauf",</p>

<pre><code>  nextPage: "/Suche/S-T/P-2/Haus-Kauf?pagerReporting=true",

  searchUrl: "/Haus-Kauf",
  isMobile: false,
  isTablet: false,
  query:     
{"realEstateType":"HOUSE_BUY","otpEnabled":true,"sortingCode":0,"location":      
{"isGeoHierarchySearch":true,
Schulze","referrer":["RESULT_LIST_GROUPED"],"**attributes":[  
{"title":"Kaufpreis","value":"249.012,75 â¬"}, 
{"title":"WohnflÃ¤che","value":"129,87 mÂ²"},{"title":"Zimmer","value":"4"},
{"title":"GrundstÃ¼ck","value":"400 mÂ²"}],"checkedAttributes":["GÃ¤ste-**
</code></pre>

<p>I am not sure how to extract the attributes at the end into a CSV. Can you please help me with the code?</p>

<p>Here is how you can pull out attribute values from a tag with beautifulSoup.</p>

<pre><code>import urllib2
from bs4 import BeautifulSoup

req = urllib2.Request('http://website_to_grab_things_from.com')
response = urllib2.urlopen(req)
html = response.read()
soup = BeautifulSoup(html, "html.parser")
alltext = soup.getText()

#soup.findAll('TAGNAME', {'ATTR_NAME' :'ATTR_VALUE'})
result = soup.findAll('div', {'class' :'teaser-text'})
</code></pre>

jquery python selenium web-scraping beautifulsoup