Well, first of all I am not sure if it is an atrribute. If it is not, please tell me the right name. The page has a div tag with the general format:
<div class="top" data-src="/a/path/to/another/page.html" id="id_random" style="position: absolute; left: 0px; top: 0px;">
I want to retrieve the value of 'data-src' attribute (?) above, which is "/a/path/to/another/page.html", using python/bs4.
I already have the html code above in a variable named target_div and I have tried things like:
target_div.find(id='data-src')
or
target_div.find ('meta', {'name':'data-src'})
or
target_div.find (attrs={'name' : 'data-src'})
Please, how to find "data-src" and its value inside a div ?
best regards,