📦 Initialize Geulbeot structure and merge Prompts & test projects
This commit is contained in:
11
02. Prompts/문서생성/codedomain/인증서_검증_Python_v01.py
Normal file
11
02. Prompts/문서생성/codedomain/인증서_검증_Python_v01.py
Normal file
@@ -0,0 +1,11 @@
|
||||
def fetch_article_content(article_url, source):
|
||||
try:
|
||||
response = requests.get(article_url, verify=False, timeout=10) # SSL 인증서 검증 비활성화 및 타임아웃 설정
|
||||
response.encoding = 'utf-8' # 인코딩 설정
|
||||
response.raise_for_status()
|
||||
soup = BeautifulSoup(response.text, 'html.parser')
|
||||
paragraphs = soup.find_all('p')
|
||||
content = ' '.join([clean_text(p.get_text()) for p in paragraphs])
|
||||
|
||||
# 텍스트 내의 엔터키를 스페이스로 대체
|
||||
content = content.replace('\n', ' ')
|
||||
Reference in New Issue
Block a user