반응형
Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- 파이썬 가상환경 설치방법
- pywinauto 윈도우
- 날짜 정규식
- 네이버 로그인 캡챠해결
- 네이버 로그인 영수증 해결
- 네이버매물크롤링
- 파이썬 네이버 로그인
- Selenium 셀렉터잡기
- 커머스API
- Uipath 기초
- pywinauto 윈도우제어
- selenium
- 파이썬 환경설정
- pycdc.exe
- uipath 입문
- pycdas.exe
- 네이버부동산크롤링
- UiPath
- 파이썬 가상환경 설치
- 왕초보 파이썬 실행
- pywinauto
- 가상환경설치
- 네이버 로그인 하기
- venv 설치
- Element is not clickable at point
- Python
- vscode venv 설치
- 네이버커머스API
- Uipath 설치방법
- 파이썬네이버부동산
Archives
- Today
- Total
콘솔워크
[나도코딩 웹스크래핑] 퀴즈1 - 다음 부동산- 헬리오시티 검색 결과 출력 본문
반응형
다음에서 헬리오시티를 검색한 결과 중 부동산 매물 정보를 읽어오는 퀴즈 입니다.
소스입니다.
개발소스:
import requests
from bs4 import BeautifulSoup
url = "https://search.daum.net/search?w=tot&DA=YZR&t__nil_searchbox=btn&sug=&sugo=&sq=&o=&q=%ED%97%AC%EB%A6%AC%EC%98%A4%EC%8B%9C%ED%8B%B0"
res = requests.get(url)
res.raise_for_status()
soup = BeautifulSoup(res.text, "lxml")
with open("real-estate.html", "w", encoding="utf8") as f:
f.write(soup.prettify())
data_rows = soup.find("table", attrs={"class": "tbl"}).find(
"tbody").find_all("tr")
for idx, row in enumerate(data_rows):
columns = row.find_all("td")
print(f"============매물{(idx+1)}============")
print("거래 ", columns[0].get_text().strip())
print("면적 ", columns[1].get_text().strip(), "(공급/전용)")
print("가격 ", columns[2].get_text().strip(), "(만원)")
print("동 ", columns[3].get_text().strip())
print("층 ", columns[4].get_text().strip())
output:
반응형
'프로그래밍 > python' 카테고리의 다른 글
[나도코딩 웹스크래핑] 네이버날씨, IT헤드라인뉴스 오늘의영어회화 최종소스 (0) | 2021.01.18 |
---|---|
[나도코딩 웹스크래핑) User-Agent 자동으로 가져오기 (0) | 2021.01.18 |
[나도코딩 웹스크래핑] 정리 (0) | 2021.01.17 |
[나도코딩 웹스크래핑] Chrome headless 최종소스 (0) | 2021.01.17 |
[Python dataframe] Union and Union ALL (0) | 2021.01.15 |