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
- restful login 메소드
- SpringBoot개인프로젝트
- initializr
- springboot mysql
- restful api 명세서
- 쿼리에러
- ERD 수정
- restful api 작성 방법
- sendError()
- jpa 연관관계
- 테이블구성
- Gradle - Kotlin
- 어노테이션
- 알고리즘
- 할일관리
- 연관관계
- 파이썬
- springboot
- 터미널 실행
- restful 카멜케이스
- intellij 속도 향상
- 테이블항목
- Intellij terminal jar
- 데이터베이스
- 아규먼트 리졸버
- create 모드
- Gradle - Groovy
- logout http 메소드
- auto ddl
- jpa
Archives
- Today
- Total
리나 Dev토리
웹개발 종합반 3주차 과제 본문
지니뮤직 사이트에서 순위, 제목, 가수이름 크롤링하기
뷰티풀숩을 처음 써보았다.
import requests
from bs4 import BeautifulSoup
#브라우저에서 call날린것처럼
headers = {'User-Agent' : 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.86 Safari/537.36'}
data = requests.get('https://www.genie.co.kr/chart/top200?ditc=M&rtm=N&ymd=20210701',headers=headers)
soup = BeautifulSoup(data.text, 'html.parser')
#body-content > div.newest-list > div > table > tbody > tr:nth-child(1) > td.number
#body-content > div.newest-list > div > table > tbody > tr:nth-child(1) > td.info > a.title.ellipsis
#body-content > div.newest-list > div > table > tbody > tr:nth-child(1) > td.info > a.artist.ellipsis
songs = soup.select('#body-content > div.newest-list > div > table > tbody > tr')
for song in songs:
-- 이하 생략 --
'스파르타 웹개발(Flask)' 카테고리의 다른 글
웹개발 종합반 5주차 과제 (0) | 2022.02.27 |
---|---|
웹개발 종합반 4주차 과제 (0) | 2022.02.25 |
웹개발종합반 2주차 - backtick(`) (0) | 2022.02.25 |
웹개발종합반 1주차 과제 (0) | 2022.02.24 |
Comments