Skip to content

Instantly share code, notes, and snippets.

@repen
Created February 9, 2020 20:28
Show Gist options
  • Save repen/1bf3305c5665320b1ee93c68bdfa8ea5 to your computer and use it in GitHub Desktop.
Save repen/1bf3305c5665320b1ee93c68bdfa8ea5 to your computer and use it in GitHub Desktop.
bs4 examp
from bs4 import BeautifulSoup
html = '''
<div class="price-v2 " data-sell-price-w-vat="29.10">
<div class="price">
<sub>€</sub>
29
<sup>10</sup>
</div>
</div>
'''
soup = BeautifulSoup(html, "html.parser")
price = soup.select_one(".price-v2")
print(price['data-sell-price-w-vat'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment