로딩
요청 처리 중입니다...

bs4를 이용한 뉴스 크롤링

 bs4를 이용한 뉴스 크롤링

내가 만들고 있는 챗봇에 넣은 기능 중 하나이다. 가장 최근 작성된 뉴스 기사를 출력해준다.

#made by Goyo import requests from bs4 import BeautifulSoup def naver_newsList(): #가장 최근 네이버 뉴스 스크래핑 url = 'https://search.naver.com/search.naver?sm=tab_hty.top&where=news&query=%EB%89%B4%EC%8A%A4&oquery=%7Bquery%7D&tqi=hxbE0sprvOsssTLXv3Rssssssqh-307213&nso=so%3Add%2Cp%3Aall&mynews=0&office_section_code=0&office_type=0&pd=0&photo=0&sort=1' response = requests.get(url) html = response.text soup = BeautifulSoup(html, 'html.parser') title = soup....

# bs4 # 크롤링 # 파이썬