1
在这里需要一些帮助。我试图打印出文字“Whirlpool®18 cu.Ft. Top Freezer Refrigerator - WRT148FZDB”,但没有找到find_all语句中的正确结构。我目前正在调用find_all作为下面的代码,但我知道这是错误的。python 3.5 find_all语句
g6_data = soup.find_all("div", {"class": "product_name"})
以下代码是我试图从中剔除信息的。
任何帮助表示赞赏。由于
<div class="product_info">
<div id="product_name_7267017" class="product_name">
<a aria-hidden="true" tabindex="-1" id="CatalogEntryViewDetailsLink_7267017" href="http://www.sears.ca/product/whirlpool-18-cuft-top-freezer-refrigerator-wrt148fzdb/646-000153197-WRT148FZDB"><span itemprop="name">Whirlpool® 18 cu.Ft. Top Freezer Refrigerator - WRT148FZDB</span></a>
<input type="hidden" id="ProductInfoName_7267017" value="Whirlpool® 18 cu.Ft. Top Freezer Refrigerator - WRT148FZDB">
</div>
为什么是错误的?当你尝试这个时会发生什么? –
Nitpicking,但这是一种方法(一种函数),而不是一个声明。 – Jules
你能给出一个链接到你从中获取html的页面吗?我知道这是在西尔斯的某个地方,但究竟是什么页面 – Keatinge