![[파이썬]워드프레스 자동포스팅](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdna%2Fdhp9gv%2FbtrOxmnkDuX%2FAAAAAAAAAAAAAAAAAAAAAPagIR7HRA0-K86xdVvtMQgl4KUf4BTzS3wOqOLehVNK%2Fimg.png%3Fcredential%3DyqXZFxpELC7KVnFOS48ylbz2pIh7yKj8%26expires%3D1756652399%26allow_ip%3D%26allow_referer%3D%26signature%3DIUzQQZNIgnFIN7pTzdP4AiswylQ%253D)
from wordpress_xmlrpc import Client from wordpress_xmlrpc import WordPressPost from wordpress_xmlrpc.methods import posts wp = Client('http://워드프레스 주소/xmlrpc.php', '아이디', '비밀번호') post = WordPressPost() post.title = 'My new title' post.content = 'This is the body of my new post.' post.terms_names = { 'post_tag': ['test', 'firstpost'], 'category': ['Introductions', 'Tests'] } post.post_status = "p..
![[파이썬]페이지 로딩될 때 까지 기다리게 하는 방법](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdna%2FdGsbr7%2FbtrOozM7dRL%2FAAAAAAAAAAAAAAAAAAAAADLcmM0EF8sBVWtS2GaNCb4u9Z30wLPPSulzznFGzpLL%2Fimg.png%3Fcredential%3DyqXZFxpELC7KVnFOS48ylbz2pIh7yKj8%26expires%3D1756652399%26allow_ip%3D%26allow_referer%3D%26signature%3DNslzNLOCwPzi%252FP6dleAnI3Nb21I%253D)
Selenium이 페이지가 모두 로딩될 때 까지 기다리게 하는 방법 단순 시간 대기 from time import sleep URL = 'http://encykorea.aks.ac.kr/Contents/CategoryNavi?category=contenttype&keyword=%EC%9D%B8%EB%AC%BC&ridx=0&tot=18507' # 원하는 페이지 지정 driver = webdriver.Chrome('chromedriver.exe') # 원하는 브라우저 엔진 선택(파일 경로) driver.get(URL) # 해당 URL로 브라우저 창을 실행 sleep(3) 브라우저 엔진이 URL을 접속하고 단순히 3초를 대기한다. 이 방법은 모든 페이지마다 항상 3초를 대기하므로 비효율적이다. 암묵적 대기(I..
![[파이썬]네이버 데이터랩 추출 및 엑셀 파일 저장(xlsx)](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdna%2FQqjD5%2FbtrOkdczBLW%2FAAAAAAAAAAAAAAAAAAAAAJ9_aE7qZVQPf_9V0ZF2v9WCdhAeg5RCcSLgL1IHSWhe%2Fimg.jpg%3Fcredential%3DyqXZFxpELC7KVnFOS48ylbz2pIh7yKj8%26expires%3D1756652399%26allow_ip%3D%26allow_referer%3D%26signature%3D1FRcAbek4y%252BFS0JaKW9N2M9%252BwpM%253D)
from selenium import webdriver from selenium.webdriver.chrome.options import Options from selenium.webdriver.common.action_chains import ActionChains import chromedriver_autoinstaller import os import requests import warnings import shutil import subprocess import time warnings.filterwarnings('ignore') try: shutil.rmtree(r"c:\chrometemp") # 쿠키 / 캐쉬파일 삭제 except FileNotFoundError: pass subprocess...
![[파이썬]셀레니움 크롬 드라이버 자동 설치 for windows](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdna%2FMIKUU%2FbtrN4ZtubcF%2FAAAAAAAAAAAAAAAAAAAAACAb-tSBfWosVlbe-pqCBFzylLzLeljDkOQQTkEoiECf%2Fimg.png%3Fcredential%3DyqXZFxpELC7KVnFOS48ylbz2pIh7yKj8%26expires%3D1756652399%26allow_ip%3D%26allow_referer%3D%26signature%3DAt3f9FozvW6V6GjIM8%252FsEB4SXiI%253D)
from selenium import webdriver import chromedriver_autoinstaller import os # Check if chrome driver is installed or not chrome_ver = chromedriver_autoinstaller.get_chrome_version().split('.')[0] driver_path = f'./{chrome_ver}/chromedriver.exe' if os.path.exists(driver_path): print(f"chrom driver is insatlled: {driver_path}") else: print(f"install the chrome driver(ver: {chrome_ver})") chromedriv..
![[파이썬]bluetooth_adapter_winrt.cc:1074 Getting Default Adapter failed error](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdna%2FQfd8s%2Fbtq5g44N4qh%2FAAAAAAAAAAAAAAAAAAAAAA4zyiW6r7SqEO0KctxQkCIiEP1-5D31oeZzhcZ2QzUp%2Fimg.png%3Fcredential%3DyqXZFxpELC7KVnFOS48ylbz2pIh7yKj8%26expires%3D1756652399%26allow_ip%3D%26allow_referer%3D%26signature%3DArPU2A%252BNKHW4fhfqWbBhCLFLCp8%253D)
exe파일로 만든 후 실행시 콘솔에 아래와 같이 오류 발생 Bluetooth: bluetooth_adapter_winrt.cc:1074 Getting Default Adapter failed error 아래코드 추가 후 해결 options = webdriver.ChromeOptions() options.add_experimental_option('excludeSwitches', ['enable-logging']) driver = webdriver.Chrome(options=options)