title: How to get partial information from JSON data in Python?
body: <p>I have a list of JSON data and hope to extract all ids from &quot;data-target-user-id&quot;. How can I do this using regex or beautifulsoup?</p>
  <pre><code>my_lst_JSON = [‘&lt;div id=&quot;a-exse-tile&quot; class=&quot;j-exse profile-tile&quot; data-exp-enabled=&quot;true&quot; user-id=&quot;115389&quot; user-type=&quot;8&quot; data-viewing-self=&quot;false&quot; &lt;!--section --&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;’,
                 ‘&lt;div id=&quot;a-exse-tile&quot; class=&quot;j-exse profile-tile&quot; data-exp-enabled=&quot;true&quot; user-id=&quot;1109&quot; user-type=&quot;9&quot; data-viewing-self=&quot;false&quot; &lt;!--section --&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;’,
                 ‘&lt;div id=&quot;a-exse-tile&quot; class=&quot;j-exse profile-tile&quot; data-exp-enabled=&quot;true&quot; user-id=&quot;2890&quot; user-type=&quot;7&quot; data-viewing-self=&quot;false&quot; &lt;!--section --&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;’,
                 ‘&lt;div id=&quot;a-exse-tile&quot; class=&quot;j-exse profile-tile&quot; data-exp-enabled=&quot;true&quot; user-id=&quot;22567&quot; user-type=&quot;8&quot; data-viewing-self=&quot;false&quot; &lt;!--section --&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;’,
                 ‘&lt;div id=&quot;a-exse-tile&quot; class=&quot;j-exse profile-tile&quot; data-exp-enabled=&quot;true&quot; user-id=&quot;33872&quot; user-type=&quot;1&quot; data-viewing-self=&quot;false&quot; &lt;!--section --&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;’]
  </code></pre>
  <p>Expected outputs:</p>
  <pre><code>['115389', '1109', '2890', '22567', '33872']
  </code></pre>
  <p>I tried the approach suggested by @zx485 with the coding below:</p>
  <p>ids_lst = []</p>
  <pre><code>for data in my_lst_JSON:
      soup = BeautifulSoup(data, 'xml')
      ids_lst.append([item.text for item in soup.findAll('div/@user-id')])
  </code></pre>
  <p>It returns a blank list...</p>
  <p>Any thought is appreciated!</p>
  <p>Thank you.</p>