질문이요
255
Inhoo Song
작성한 질문수 5
2
import requests
from bs4 import BeautifulSoup
req = requests.get('https://www.donga.com/news/Entertainment/List?p=1&prod=news&ymd=&m=')
soup = BeautifulSoup(req.text, 'html.parser')
for i in soup.select("#contents > div.page > a") :
req2 = requests.get("http://www.donga.com/news/List/Enter/" + i['href'])
soup2 = BeautifulSoup(req2.text, 'html.parser')
for i in soup2.find_all("span", class_="tit") :
print(i.text)
C:\Users\karma\PycharmProjects\pychamwebcrawling\venv\Scripts\python.exe "C:/Users/karma/PycharmProjects/pychamwebcrawling/01_web_crawling_naver_test/url 링크 찾아내서 크롤링.py" Process finished with exit code 0
머가 문제인건가요???
답변 4
0
import requests
from bs4 import BeautifulSoup
req = requests.get('https://www.donga.com/news/Entertainment/List?p=1&prod=news&ymd=&m=')
soup = BeautifulSoup(req.text, 'html.parser')
print(soup.select("#content > div.page > a"))
for i in soup.select("#content > div.page > a") :
print("http://www.donga.com/news/List/Enter/" + i['href'])
예시문제 작업형2 (ver2023) 질문입니다
0
6
1
Data type에 따른 처리
0
4
1
Cursor 실행 문의
1
10
2
데이터 전처리 관련
0
9
2
시험에서 문제 불러오기
0
7
2
2번문제 출력값 질문
0
12
2
pd.get_dummies()가 bool로 반환
0
14
2
대응표본검정 레빈
0
17
3
단일표본검정 문제 유형
0
17
2
[작업형 3] 6~7. 카이제곱 검정
0
15
2
안녕하세요 파이썬 관련 문의드립니다
0
283
1
개발자님 도와주세요
0
217
1
질문입니다
0
253
3
크롬드라이버 설치
0
270
1
크롬드라이버 설치질문
0
212
1
브라우저가 안나와요
0
234
1
에디터와 모듈 관련
0
207
1
여러 페이지 크롤링
0
278
3
패키지 설치 방법 알려주세요
0
408
3
셀레니움 설치 관련
0
256
1
12페이지 이후 print
0
206
3
파이참설치안하고 아나콘다의 주피터 노트북으로 강의내용 따라가도되나요~?
0
246
3
chromedriver 라이브러리
2
325
3
다음 실시간 검색어 클래스 추출 불가
1
284
1





