Skip to content

Commit f084e02

Browse files
author
Adriano Sanges
committed
Enhance scraper.py with additional debug output
- Add print statement to output the response text from the main listing page - Improve visibility into the data being fetched during the scraping process
1 parent 325020b commit f084e02

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

real-estate-etl/scraper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ def parse_page(url: str) -> Dict[str, Optional[any]]:
3434
listings = soup.select('section.ld-layoutContentCenter')
3535
for listing in listings:
3636
# Extract title, city, neighborhood, road
37-
print(listing)
3837
title = soup.find('meta', property='og:title')
3938
city, neighbourhood, road = None, None, None
4039
if title:
@@ -102,6 +101,7 @@ def parse_listing(url: str) -> List[Dict[str, Optional[any]]]:
102101
}
103102
logging.debug("Fetching main listing page: %s", url)
104103
response = requests.get(url, headers=headers)
104+
print(response.text)
105105
soup = BeautifulSoup(response.text, 'html.parser')
106106
data_list = []
107107
links = soup.select('a.in-listingCardTitle')

0 commit comments

Comments
 (0)