【发布时间】:2015-03-02 06:58:24
【问题描述】:
我正在用BeautifulSoup 抓取this URL。
我想抓取 Our Features 标题之后的每个 DIV:
if hotel_meetings_soup.select("div#contentArea div.highlightBox"):
print(hotel_meetings_soup.select("div#contentArea")) # debug 1
exit(0)
for meeting in hotel_meetings_soup.select("div#contentArea div.highlightBox"):
print("\n Feature start here\n")
print(meeting)
# Rest of code
所有的 DIV 都有相同的类 highlightBox 但我不知道为什么 debug 1 只打印具有
Number Of Guest Rooms: 500
Number Of Meeting Spaces: 29
Largest Meeting Space: 17,377 sq ft (1,614.28 sq.m)
在其中,但不在其他人中。
【问题讨论】:
标签: python html python-3.x web-scraping beautifulsoup