Extract dictionary object inside a Div with Beautiful Soup
<p>I have the following sample: </p>

<pre><code>    [&lt;div class="options__list"&gt;
    &lt;a href="/link1"&gt;
    &lt;div class="options__list__item" option-message="closed" data-option='{"id":1,"is_active":true,"name":"Fran","city":{"id":32,"name":"Paris","is_top":null,"url_key":"paris","main_area":{"id":null,"name":null,"url_key":null}}}'&gt;&lt;/div&gt;
&lt;/a&gt;&lt;a href="/link2"&gt;
    &lt;div class="options__list__item" option-message="closed" data-option='{"id":2,"is_active":true,"name":"Fran2","city":{"id":32,"name":"Paris","is_top":null,"url_key":"paris","main_area":{"id":null,"name":null,"url_key":null}}}'&gt;&lt;/div&gt;
&lt;/a&gt;]
</code></pre>

<p>I would like to extract :</p>

<ol>
<li>the href link </li>
<li>the dictionary "data-option".</li>
</ol>

<p>What is the best way to do this? Moreover, let's say that I only wanted to extract specific keys from the "data-option" dictionary, how would I do that?</p>

<p>Many thanks in advance.</p>