用美丽的汤找到元素

时间:2017-12-13 18:32:42

标签: python html css

<div class="product-header-wrapper">
    <div class="prices-container">
        <p class="price price--large">£250.00</p>
    </div>
</div>

这是我的代码

import requests
from bs4 import BeautifulSoup

request = requests.get("https://www.johnlewis.com/herman-miller-classic-aeron-office-chair/p230630306")
content = request.content
soup = BeautifulSoup(content, "html.parser")
element = soup.findAll(classmethod = 'price price--large')
print(element.text)


print(request.content)"

我希望在我的代码中打印价格。

0 个答案:

没有答案