网页抓取格式不正确的网站

我正在抓取一个网站链接“https://homeshopping.pk/search.php?q=samsung%20phones”。我发现很难进入 div 课程之一。我认为它的格式不正确。问这个问题的原因是为了确认它是否格式不正确或者我做错了什么。

截图是:

https://img1.mukewang.com/650800dc000108af13510491.jpg

from bs4 import BeautifulSoup as soup  # HTML data structure

from urllib.request import urlopen as uReq  # Web client


page_url = "https://homeshopping.pk/search.php?q=samsung%20phones"


uClient = uReq(page_url)


page_soup = soup(uClient.read(), "html.parser")

uClient.close()


print(page_soup)


# finds each product from the store page

container1 = page_soup.find_all("div", {"class": "findify-container findify-search findify-widget-2"})


len(container1)

print(container1)


一只甜甜圈
浏览 61回答 0
0回答
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Html5