본문 바로가기
반응형

전체 글54

Python3 selenium click이 되지 않을 때 JavaScript를 사용하여 요소를 클릭, element_to_be_clickable, iframe, ActionChains # 요소 찾아 변수에 저장 element = wait(driver, 10).until(EC.visibility_of_element_located((By.XPATH, "찾을 요소"))) # JavaScript를 사용하여 요소를 클릭 driver.execute_script("arguments[0].click();", element ) wait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, "찾을 요소" ))).click() element1 = wait(driver, 10).until(EC.presence_of_element_located((By.ID, "down"))) #iframe 태크 엘리먼트 찾기 driver.switch_to.frame(elemen.. 2023. 11. 18.
python3 selenium ChromeDriver service, options from selenium import webdriver from selenium.webdriver.chrome.options import Options from selenium.webdriver.chrome.service import Service from webdriver_manager.chrome import ChromeDriverManager options = Options() options.add_experimental_option("detach", True) # 크롬 꺼짐 방지 options.add_experimental_option("excludeSwitches", ["enable-automation"]) # 자동화된 소프트웨어 문구 제거 options.add_experimental_optio.. 2023. 11. 17.
Mac OS 파이썬 가상환경 만들기/활성화 Mac OS 파이썬 가상환경 만들기 $ python3 -m venv ./{your venv name} Mac OS 파이썬 가상환경 활성화 $ source {your venv name}/bin/activate 2023. 10. 19.
pyinstaller, webdriver 콘솔창 안뜨게하기 pyinstaller 실행파일 콘솔창 안뜨게하기1. pyinstaller로 실행 파일 생성 2.생성된 *.spec 파일 수정 console=True, 를 console=False, 로 수정하고 저장합니다. exe = EXE( pyz, a.scripts, a.binaries, a.zipfiles, a.datas, [], name='camfit', debug=False, bootloader_ignore_signals=False, strip=False, upx=True, upx_exclude=[], runtime_tmpdir=None, console=False, disable_windowed_traceback=False, argv_emulation=False, target_arch=None, codesign_.. 2023. 9. 19.
캠핑장 예약 매크로, 캠핏 예약 매크로 파이썬으로 작성된 캠핏 자동 예약 매크로입니다. 문의는 댓글로 부탁드립니다. 2023. 9. 13.
python3 selenium 웹사이트 화면 스크롤 이동하기 selenium으로 웹을 제어하다보면 화면을 벗어나 스크롤을 이동 할 경우가 발생한다. 스크롤을 이동하는 3가지 방법 xpath, class name, text로 요소를 찾고 스크롤 이동하기. 네이버 메인화면에 "뉴스홈" 으로 스크롤 이동하기 실습. chrome 네이버 접속 후 개발자 모드에서 "뉴스홈" Class name, xpath, text를 확인하고 아래 소스코드에 대입. 기본적인 소스코드는 동일. 1.class name from selenium import webdriver from selenium.webdriver.chrome.options import Options from selenium.webdriver.common.by import By options = Options() options.. 2023. 6. 9.
반응형