【发布时间】:2021-02-26 06:24:55
【问题描述】:
我希望从此搜索结果页面抓取 IBM Watson Studio Jupyter Notebook 中的数据:
https://www.aspc.co.uk/search/?PrimaryPropertyType=Rent&SortBy=PublishedDesc&LastUpdated=AddedAnytime&SearchTerm=&PropertyType=Residential&PriceMin=&PriceMax=&Bathrooms=&OrMoreBathrooms=true&Bedrooms=&OrMoreBedrooms=true&HasCentralHeating=false&HasGarage=false&HasDoubleGarage=false&HasGarden=false&IsNewBuild=false&IsDevelopment=false&IsParkingAvailable=false&IsPartExchangeConsidered=false&PublicRooms=&OrMorePublicRooms=true&IsHmoLicense=false&IsAllowPets=false&IsAllowSmoking=false&IsFullyFurnished=false&IsPartFurnished=false&IsUnfurnished=false&ExcludeUnderOffer=false&IncludeClosedProperties=true&ClosedDatesSearch=14&MapSearchType=EDITED&ResultView=LIST&ResultMode=NONE&AreaZoom=13&AreaCenter[lat]=57.14955426557916&AreaCenter[lng]=-2.0927401123046785&EditedZoom=13&EditedCenter[lat]=57.14955426557916&EditedCenter[lng]=-2.0927401123046785
我已经尝试过 BeautifulSoup 并尝试过 Selenium(完全公开:我是初学者)对多种代码变体。我已经在 Stack Overflow、Medium 文章等上解决了几十个问题,但我无法理解我做错了什么。
我最近在做的是:
from bs4 import BeautifulSoup
html_soup = BeautifulSoup(response.text, 'html.parser')
type(html_soup)
properties_containers = html_soup.find_all('div', class_ = 'information-card property-card col ')
print(type(properties_containers))
print(len(properties_containers))
这将返回 0。
<class 'bs4.element.ResultSet'>
0
有人可以指导我正确的方向吗?我做错了什么/错过了什么?
【问题讨论】:
标签: html web-scraping beautifulsoup jupyter-notebook ibm-watson