我正在抓取一个网站链接“https://homeshopping.pk/search.php?q=samsung%20phones”。我发现很难进入 div 课程之一。我认为它的格式不正确。问这个问题的原因是为了确认它是否格式不正确或者我做错了什么。截图是:from bs4 import BeautifulSoup as soup # HTML data structurefrom urllib.request import urlopen as uReq # Web clientpage_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 pagecontainer1 = page_soup.find_all("div", {"class": "findify-container findify-search findify-widget-2"})len(container1)print(container1)
目前暂无任何回答
- 0 回答
- 0 关注
- 60 浏览
添加回答
举报
0/150
提交
取消