首页 > 解决方案 > 为什么我的 beautifulsoup 解析只是一个元标记?

问题描述

所以我一直在做一些我想尝试用snk结帐页面测试的东西,我需要 html 代码才能工作,但是当我解析数据时,我看到的只是一个带有元标记的标题。我对这种东西有点陌生,但是有没有办法克服这个并获得实际的 html?

import requests
from bs4 import BeautifulSoup
url = "https://shopnicekicks.com/2192362/checkouts/009e91a67c7040239a40bdaafb11e671?_ga=2.173244707.1809809349.1528354207-1821146214.1528354207"
r = requests.get(url)
soup = BeautifulSoup(r.content, "lxml")
searches = soup.find("div", class_="field__input-wrapper")

print(soup)
print(searches)

print(soup)部分是我主要担心的

这是它的输出

<html>
    <head>
        <meta content="0; url=https://shopnicekicks.com/2192362/checkouts/009e91a67c7040239a40bdaafb11e671?_ga=2.173244707.1809809349.1528354207-1821146214.1528354207&amp;no_cookies_from_redirect=1" http-equiv="refresh"/>
    </head>
</html>

标签: python

解决方案


推荐阅读