title: beautifulsoup get URL from javascript variable
body: <p>I'm trying to get URL from a javascript through beautifulsoup. I have the following javascript source</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
              var abc_url = "http://www2.example.com/ar/send/0?tk=13_s&amp;id=12345678&amp;l=9";
              var etc = [
                      'http://xyz.example.com/content/1.png',
                       'http://xyz.example.com/content/2,png' ];
  &lt;/script&gt;
  </code></pre>
  
  <p>I've tried the following statement in python but "print m" returns None. </p>
  
  <pre><code>soup = BeautifulSoup(page)
  
  p = re.compile('/var abc_url = (.*);/')        
  all_script  = soup.find_all("script", {"src":False})
  for individual_script in all_script:
      all_value =  individual_script.string        
      if all_value:            
          m = p.match(all_value)
          print m           
  </code></pre>
  
  <p>Using <a href="http://www.regexr.com/" rel="nofollow">RegExr</a> it seems to be able to get the entire line of "var abc_url..." based on above regex but in my code it doesn't work. Wondering how can I get the URL value of this?</p>
  
  <p>Thank you</p>