- 전체
- Python 일반
- Python 수학
- Python 그래픽
- Python 자료구조
- Python 인공지능
- Python 인터넷
- Python SAGE
- wxPython
- TkInter
- iPython
- wxPython
- pyQT
- Jython
- django
- flask
- blender python scripting
- python for minecraft
- Python 데이터 분석
- Python RPA
- cython
- PyCharm
- pySide
Python 인터넷 [python 인터넷] Selenium Python button 클릭
2021.11.26 19:45
[python 인터넷] Selenium Python button 클릭
질문
내 시스템에서 내 button을 클릭하게하는 방법을 찾을 수 없습니다.여기에 button (또는 첨부 파일)의 코드가 있습니다.
<button class="btn btn-primary btn-captcha" id="invisibleCaptchaShortlink" type="submit">continue</button>
이 명령을 이미 시도했지만 작동하지 않습니다.
search = driver.find_element_by_name("invisibleCaptchaShortlink")
search.click()
답변1
xpath 아래 사용 ::
driver.find_element_by_xpath("//button[@id='invisibleCaptchaShortlink'][contains(text(),'continue')]")
또는
driver.find_element_by_id("invisibleCaptchaShortlink")
find_element_by_id
를 사용해야하는 대신 유효하지 않은 find_element_by_name
요소를 찾기 위해 xpath 위에 잘못된 전략을 사용하여 요소를 검색하려고합니다.
출처 : https://stackoverflow.com/questions/61250670/selenium-python-click-a-button
[출처] https://qastack.tistory.com/entry/Selenium-Python-button-%ED%81%B4%EB%A6%AD
본 웹사이트는 광고를 포함하고 있습니다.
광고 클릭에서 발생하는 수익금은 모두 웹사이트 서버의 유지 및 관리, 그리고 기술 콘텐츠 향상을 위해 쓰여집니다.
광고 클릭에서 발생하는 수익금은 모두 웹사이트 서버의 유지 및 관리, 그리고 기술 콘텐츠 향상을 위해 쓰여집니다.