본문 바로가기

selenium.webdriver 쿠키 제어 쿠키 백업 c = driver.get_cookies() with open('cookie.dat', 'wb') as f: pickle.dump(c, f) 쿠키 복원 f = open('cookie.dat', 'rb') cookies = pickle.load(f) f.close() for c in cookies: driver.add_cookie(c)
selenium.webdriver.remote.webelement.WebElement 함수 'application_cache', 'back', 'capabilities', 'close', 'command_executor', 'create_options', 'create_web_element', 'current_url', 'current_window_handle', 'delete_all_cookies', 'delete_cookie', 'desired_capabilities', 'error_handler', 'execute', 'execute_async_script', 'execute_cdp_cmd', 'execute_script', 'file_detector', 'file_detector_context', 'find_element', 'find_element_by_class_name', 'fin..
웹 쿼리 - 브라우저처럼 URL = "주소" headers = { 'Host': 'm.search.naver.com', 'Connection': 'keep-alive', 'Cache-Control': 'max-age=0', 'Upgrade-Insecure-Requests': '1', 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8', 'Accept-Encoding': 'gz..
스케쥴러 라이브러리 $ pip install schedule import schedule import time def job(): print("I'm working...") schedule.every(10).minutes.do(job) schedule.every().hour.do(job) schedule.every().day.at("10:30").do(job) schedule.every().monday.do(job) schedule.every().wednesday.at("13:15").do(job) while True: schedule.run_pending() time.sleep(1)https://schedule.readthedocs.io/en/stable/api.html#main-interface