Mail Send(ft. Sent Folder Save)
# Script/Python2024. 4. 4. 17:28Mail Send(ft. Sent Folder Save)

import smtplib import imaplib import email import time from email.utils import make_msgid from email.mime.text import MIMEText # SMTP 서버 설정 smtp_server = 'SMTP서버' smtp_port = 465 smtp_username = '사용자ID' smtp_password = '비밀번호' # IMAP 서버 설정 imap_server = 'IMAP서버' imap_port = 993 imap_username = '사용자ID' imap_password = '비밀번호' # 이메일 발신자, 수신자, 제목 및 내용 설정 from_email = '발신자 메일주소' to_email = '수신자 메일주소' ..

크롬드라이버 버전 이슈
# Script/Python2023. 9. 11. 15:18크롬드라이버 버전 이슈

from selenium import webdriver from selenium.webdriver.chrome.service import Service from selenium.webdriver.chrome.options import Options from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.by import By import time # 크롬 드라이버 자동 업데이트 from webdriver_manager.chrome import ChromeDriverManager #브라우저 꺼짐 방지 chrome_options = Options() chrome_options.add_experimental_option("d..

[파이썬]파파고 API 연동
# Script/Python2023. 2. 8. 13:07[파이썬]파파고 API 연동

신청 URL https://developers.naver.com/apps/#/register 애플리케이션 - NAVER Developers developers.naver.com 예제 import json import os import sys import urllib.request client_id = "ZOB" # 개발자센터에서 발급받은 Client ID 값 client_secret = "zs" # 개발자센터에서 발급받은 Client Secret 값 #encText = urllib.parse.quote("I'm going to write a blog about Korea, so please let me know in 2000 characters.") encText = urllib.parse.quote("..

[파이썬]텔레그램 푸시(2023버전)
# Script/Python2023. 1. 17. 10:45[파이썬]텔레그램 푸시(2023버전)

파이참을 작성해서 텔레그램 푸시를 테스트해볼려고하니 기존에 사용했던 방식은 먹히지 않아 구글링해본 결과 최근 텔레그램봇이 v20으로 업데이트 되면서 문제가 발생 해서 아래와 같이 하면 동작. import telegram import asyncio chat_token = "#############################" bot = telegram.Bot(token = chat_token) text = '안녕하세요' #### 리눅스에서는 아래 코드 삭제 또는 주석처리해야함 #### asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy()) asyncio.run(bot.sendMessage(chat_id = "#############..

[파이썬]Beautifulsoup 이용 xml 파씽(기상청 육상 중기예보)
# Script/Python2022. 12. 28. 12:59[파이썬]Beautifulsoup 이용 xml 파씽(기상청 육상 중기예보)

from bs4 import BeautifulSoup import urllib.request as MyURL japi = 'http://www.kma.go.kr/weather/forecast/mid-term-rss3.jsp?stnId=109' response = MyURL.urlopen(japi) weather = BeautifulSoup(response, "html.parser") for location in weather.findAll('location'): print(location.city.string) print("="*20) for data in location.findAll('data'): print("시간:",data.tmef.string) print("날씨:",data.wf.string)..

image