Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 7f19195

Browse files
get title, address, phone of restaurant
1 parent 63f5f95 commit 7f19195

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

‎extract_details.py‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@
1818
businesses = soup.findAll('div', {'class': 'biz-listing-large'})
1919

2020
count = 0
21-
for info in businesses:
22-
print(info.text)
23-
count += 1
24-
25-
print(count)
21+
for biz in businesses:
22+
title = biz.find('a', {'class': 'biz-name'}).text
23+
print(title)
24+
address = biz.find('address').text
25+
print(address)
26+
phone = biz.find('span', {'class': 'biz-phone'}).text
27+
print(phone)

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /