title: Scrape script tag with python selenium xpath
body: <p>Let's say I would like to scrape some metadata from a website:</p>
  
  <p><a href="https://www.diepresse.com/4913597/autocluster-buhlt-um-osterreich-teststrecke-fur-google-autos" rel="nofollow noreferrer">https://www.diepresse.com/4913597/autocluster-buhlt-um-osterreich-teststrecke-fur-google-autos</a> </p>
  
  <p>To be more precise, i.e. from the Key <code>fullChannel</code> the Value <code>/home/wirtschaft/international</code> from this <code>&lt;script&gt;</code> tag:</p>
  
  <pre><code>&lt;script&gt;    
  let pageBreakpoint = 'desktop';
  let _screen = window.innerWidth;
  if (_screen &lt; 640) {
      pageBreakpoint = 'mobile';
  } else if (_screen &lt; 1024) {
      pageBreakpoint = 'tablet';
  }
  
  var dataLayer = window.dataLayer || [];
      dataLayer.push({
          'siteId': 'dpo',
          'contentId': '4913597',
          'pageType': 'article',
          'contentTitle': 'Autocluster buhlt um Österreich-Teststrecke für Google-Autos',
          'contentAuthor': '',
          'contentElements': '',
          'contentType': 'default',
          'pageTags': '',
          'wordCount': '264',
          'wordCountRounded': '400',
          'contentSource': '',
          'contentPublishingDate': '',
          'contentPublishingDateFormat': '28/01/2016',
          'contentPublishingTime': '08:52',
          'contentPublishingTimestamp': '28/01/2016 08:52:00',
          'contentRepublishingTimestamp': '28/01/2016 08:52:00',
          'contentTemplate': 'default',
          'metaCategory': '',
          'channel': 'international',
          'fullChannel': '/home/wirtschaft/international',
          'canonicalUrl': '',
          'fullUrl': window.location.href,
          'oewaPath': 'RedCont/Wirtschaft/Wirtschaftspolitik',
          'oewaPage': 'homepage',
          'isPremium':'no',
          'isPremiumArticle': 'free',
          'pageBreakpoint': pageBreakpoint,
          'userId': ''
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>Right now I am using Selenium and Xpath and can't really figure out how to use regex on this:</p>
  
  <pre><code>#this doesnt work
  driver.find_element_by_xpath("//script[text()]")
  </code></pre>
  
  <p>Any suggestions?</p>