title: Scrapy get text from function ()
body: <p>I want to get the branchId in function but couldnt. Do you have any idea about how to get from a function.</p>
  
  <pre><code>item["branchId"] = row.xpath('//div[@class="branchprofile"]//script/text()').extract()[0]
  </code></pre>
  
  <p>HTML Code:</p>
  
  <pre><code>&lt;div id="branchprofile"&gt;
  &lt;script&gt;
  (function(k,v){RMVH.ANALYTICS.DataLayer.pushKV(k,v);}('branch',{"branchId":5112345,"companyName":"KLM","brandName":"London KLM",,"pageType":"Standard"})); &lt;/script&gt;
  </code></pre>