웹 스크래퍼 (1) 썸네일형 리스트형 [python] 파이썬 기초 - 웹 스크래퍼 간단 예제 파이썬 설치 Linux : sudo apt-get update sudo apt-get install python3 requests 라이브러리 설치 pip install requests Beautiful Soup 라이브러리 설치 pip install beautifulsoup4 웹 크롤링 예제 코드 작성 import requests from bs4 import BeautifulSoup url = 'https://news.naver.com' response = requests.get(url) # HTML 파싱 soup = BeautifulSoup(response.text, 'html.parser') # 뉴스 제목 추출 news_titles = soup.select('.cjs_t') print('start') .. 이전 1 다음