Created
February 9, 2020 20:28
-
-
Save repen/1bf3305c5665320b1ee93c68bdfa8ea5 to your computer and use it in GitHub Desktop.
bs4 examp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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