0

I am trying to find a certain value in this HTML in between this anchor tag. I cant seem to get it.

HTML:

<a id="share_-pinterest" href="javascript:void(0);" aria-label="Share on Pinterest (New window)" class="share-pinterest externalLink notLink" data-link="http://pinterest.com/pin/create/button/?url=https%3A%2F%2Fus.louisvuitton.com%2Feng-us%2Fproducts%2Fpocket-organizer-monogram-other-nvprod2380073v&description=Discover Louis Vuitton Pocket Organizer via Louis Vuitton" target="_blank" data-image="https://us.louisvuitton.com/images/is/image/lv/1/PP_VP_L/louis-vuitton--M69679_PM2_Front view.jpg" data-network="pinterest" data-evt-action-position="product_area" data-evt-action-type="share_interaction" data-evt-action-id="share_channel_id_selection" data-evt-position-number="" data-evt-content-type="" data-evt-content-id="" data-evt-channel-id="pinterest" data-evt-event="share" data-evt-category-ga="product_sheet" data-evt-action-ga="share" data-evt-label-ga="share_channel_id_selection">
<svg viewBox="0 0 80 80" focusable="false" aria-hidden="true" class="ui-icon-social-pinterest"></svg>
</a>

What im searching for:

data-image="https://us.louisvuitton.com/images/is/image/lv/1/PP_VP_L/louis-vuitton--M69679_PM2_Front view.jpg"

Code:

from urllib.request import Request, urlopen
from bs4 import BeautifulSoup as soup

HEADERS = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko)'}

req = Request('https://us.louisvuitton.com/eng-us/products/pocket-organizer-monogram-other-nvprod2380073v', headers=HEADERS)

webpage = urlopen(req).read()
page_soup = soup(webpage, "html.parser")]

img = page_soup.find('a', {'data-image'})    
print(img)

Output

None

Output Wanted:

https://us.louisvuitton.com/eng-us/products/pocket-organizer-monogram-other-nvprod2380073v

Any help would be appreciated.

0 Answers0