Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
myeowon authored Feb 1, 2024
1 parent 24ddd97 commit 7bb0d6c
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions notice.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#학과 공지사항
import requests
from bs4 import BeautifulSoup
from selenium.webdriver.common.by import By
url = "https://cse.pusan.ac.kr/cse/14651/subview.do"
res = requests.get(url)
res.raise_for_status()
soup = BeautifulSoup(res.text,"lxml")

f = open("notice.txt","w",encoding = 'utf-8')

articles = soup.find_all("td",attrs={"class":"_artclTdTitle"})
for article in articles:
if (article.find_previous_sibling("td").get_text().isdigit()):
dict = {}
title = article.strong.get_text()
date = article.find_next_sibling("td").find_next_sibling("td").get_text()
f.write( date + "," + title + "\n")

f.close()

0 comments on commit 7bb0d6c

Please sign in to comment.