본문 바로가기

웹크롤링3

(웹크롤링)파이썬, python, BeautifulSoup_ 3. 멜론 차트 크롤링 목차 1. 기본 설정 import requests from bs4 import BeautifulSoup from selenium import webdriver # 멜론 차트 사이트 접속 driver_path = 'C:/Users/Playdata/Desktop/dev/setup/chromdriver.exe' driver = webdriver.Chrome(driver_path) url = 'https://www.melon.com/chart/' driver.get(url) # 멜론 차트 크롤링 html = driver.page_source soup = BeautifulSoup(html, 'html.parser') 2. 웹크롤링 서비스, 순위, 제목, 가수 정보를 크롤링 하여 엑셀 파일로 저장하기 2-1. 제목.. 2023. 5. 18.
(웹크롤링)파이썬, python, BeautifulSoup_ 2. BeautifulSoup 설치 및 기본 목차 1. BeautifulSoup 설치 pip install beautifulsoup4 # 터미널에서 설치 python -m pip install beautifulsoup4 # 가상환경의 파이썬에서 설치 python -m pip install requests 2. BeautifulSoup 기본 실습 from bs4 import BeautifulSoup import requests # html 코드 가져오기 response = requests.get('http://127.0.0.1:5500/crawling/01.%20html_basic/html_basic_table.html') html = response.text print(response.text) 2-1. select html = response.t.. 2023. 5. 17.
(웹크롤링) 1. 웹크롤링 Intro 목차 Intro 웹 크롤링을 할 때, 원하는 부분만 추출하기 위해서 HTML과 CSS 기본을 배워야한다. 오늘은 웹페이지의 기본 뼈대인 HTML의 간단한 태그들을 배우고 이 태그들을 선택하기 위한 CSS를 배울 예정이다. 또한, 파이썬의 웹크롤링 라이브러리는 BeautifulSoup과 Selenium 을 사용하는데 각자의 장점인 부분을 활용하여 보통 둘다 사용하기 때문에 모두 다뤄볼 예정이다. 1. 웹의 기초 개념: Overview https://wikidocs.net/85426 01장-2 WEB이란 .list ol { border: 1px solid blue; width:100% height:50px; padding:20px 50px; margin-bottom… wikidocs.net 앱은 OS마다 개.. 2023. 5. 17.