title: How to extract data from javascript array using beautiful soup?
body: <p>The javascript file looks like this:</p>
  
  <pre><code>states_arr['Chittoor']= new Array(  "Kurnool (Abbas Nagar)# 9247001529             # H. No. 80-11/111, ; Beside ICICI Bank ATM, ;  Near Krishna Nagar Railway Gate, ; Abbas Nagar,  Kurnool.","Kurnool # 9247001530 # H. No. 46/694, Near Annapurna Hotel, Opp. Govt Hospital, Budawarpet, Kurnool. "  );
  </code></pre>
  
  <p>I want to extract the address from all the arrays in the js file that starts after the second '#' sign i.e.  " H. No. 80-11/111, ; Beside ICICI Bank ATM, ;  Near Krishna Nagar Railway Gate, ; Abbas Nagar,  Kurnool.",
                                      "H. No. 46/694, Near Annapurna Hotel, Opp. Govt Hospital, Budawarpet, Kurnool. "</p>
  
  <p>The above complete javascript file is available at :
  <a href="http://www.heteropharmacy.com/jScript/myScript.js" rel="nofollow">http://www.heteropharmacy.com/jScript/myScript.js</a></p>
  
  <p>I am using BeautifulSoup for that matter and here is my incorrect code:</p>
  
  <pre><code>soup = BeautifulSoup(html_doc)
  script = soup.find_all("script")
  pattern = re.compile(r" (?&lt;=[0-9]\s#\s).+")
  while pattern.search(script):
      line1 = pattern.search(script)
      print line1
  </code></pre>
  
  <p>This file then needs to be converted into json format.</p>