728x90
반응형
파이썬 셀레니움 오류
no such element: Unable to locate element: {"method":"css selector","selector":"body > div > div.workseditor-content"
# 내용 입력하기
iframe = driver.find_element(By.CSS_SELECTOR,'#content > div.contents_area > div > div.editor_area > div > div.editor_body > iframe')
driver.switch_to.frame(iframe)
driver.find_element(By.CSS_SELECTOR, 'body > div > div.workseditor-content').click()
pyperclip.copy("오늘은 1월 6일 금요일이야.")
with pyautogui.hold(['command']):
time.sleep(1)
pyautogui.press('v')
iframe 때문에 그렇다고 한다.
그래서 iframe에 포커스를 맞추고 찾으면 잘 찾아진다. (switch_to.frame()사용)
728x90
반응형
'공부👻' 카테고리의 다른 글
셀레니움 도전,,,🐾 (2) | 2023.01.05 |
---|---|
/bin/sh: python: command not found (0) | 2023.01.04 |
XHR failed Vscode Extension 설치 안 됨 (0) | 2023.01.03 |
카카오톡 크롤링 - 워드 클라우드, 파이썬 🥳~ (2) | 2022.12.29 |