파이썬으로 영화 예매 오픈 알리미 만들기

JOY·2021년 12월 3일
0

Python

목록 보기
1/1

파이썬으로 영화 예매 오픈 알리미 만들기

1. 웹크롤링 준비하기

📌 CGV 용산아이파크몰 극장의 상영시간표 가져오기
chrome의 개발자도구(F11) 이용하여 iframe 태그로 이루어진 상영시간표 크롤링

* requests 모듈
간편한 HTTP 요청처리를 위해 사용하는 모듈

  1. 커맨드 창 띄우기
  2. 파이썬이 설치된 경로로 변경 ( cd 명령어 사용 )
  3. pip install bs4 requests 명령어 입력하여 설치

✍ 모듈 설치 확인하는 방법

import requests
requests

👉 결과
설치된 경로가 출력 되면 설치 완료

2. requests로 페이지 정보 가져오기

python

import requests
from bs4 import BeautifulSoup

url = 'http://www.cgv.co.kr/common/showtimes/iframeTheater.aspx?areacode=01&theatercode=0013&date=20211203'
html = requests.get(url)
print(html.text)

> 실행결과



profile
Just Do IT ------- 🏃‍♀️

0개의 댓글