Skip to content

Instantly share code, notes, and snippets.

@wapj
Last active August 20, 2018 10:30
Show Gist options
  • Save wapj/d1804ec42056e793ed5f149a88f9a2b8 to your computer and use it in GitHub Desktop.
Save wapj/d1804ec42056e793ed5f149a88f9a2b8 to your computer and use it in GitHub Desktop.
pycon2018_slides.py
import requests
from bs4 import BeautifulSoup
URL = 'https://www.pycon.kr/2018/program/schedule/'
def get_html(url):
r = requests.get(url)
if r.status_code == 200:
return r.text
return None
html = get_html(URL)
soup = BeautifulSoup(html, 'html.parser')
programs = soup.find_all("div", {"class": "program"})
def get_slide(program):
if program.find("small") and program.find("small").a:
return program.find("small").a.get('href')
return None
for program in programs:
slide_url = get_slide(program)
if slide_url:
title = program.find("div").text.strip()
href = "https://www.pycon.kr/" + program.find("a").get("href")
print("### [{}]({})".format(title, href ))
print(slide_url)
print("")
@wapj
Copy link
Author

wapj commented Aug 20, 2018

아래의 커맨드로 문서를 만듭니다.

python pycon_slide.py > pycon_slides.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment