Chrome에서 Excel VBA 자동화와 함께 Selenium Webdriver를 사용하고 있으며 사용자가 버튼을 클릭 할 때까지 기다리는 데 문제가 있습니다.
웹 코드는 다음과 같습니다.
FindElementByCss, FindElementByID ..., IsPresent, IsEnabled ...와 함께 시도했지만 아무것도 작동하지 않았습니다. 현재 Mi 코드는 다음과 같습니다.
t = Timer
Do While bot.FindElementById("ui-button-text").IsPresent = True
bot.Wait 500
If Timer - t = 10 Then Exit Do 'Para evitar bucle infinito
Loop
미리 감사드립니다!
HTML에 따라 :
ui-button-text
class
속성 의 값 이지만 속성 의 값이 아니며 다른 textContent 와 같이 속성 값을 가진 id
여러 <span>
요소가 있습니다.class
ui-button-text
요소 가 있는지 확인하려면 다음 로케이터 전략을 사용할 수 있습니다 .
Cancelar 로 텍스트가있는 요소 :
xpath 사용 :
Do While bot.FindElementByXPath("//span[@class='ui-button-text' and text()='Cancelar']").IsPresent = True
Repetir 로 텍스트가있는 요소 :
xpath 사용 :
Do While bot.FindElementByXPath("//span[@class='ui-button-text' and text()='Repetir']").IsPresent = True
텍스트가 Aceptar 인 요소 :
xpath 사용 :
Do While bot.FindElementByXPath("//span[@class='ui-button-text' and text()='Aceptar']").IsPresent = True
요소가 활성화 되었는지 확인하려면 다음 로케이터 전략을 사용할 수 있습니다 .
Cancelar 로 텍스트가있는 요소 :
xpath 사용 :
Do While bot.FindElementByXPath("//span[@class='ui-button-text' and text()='Cancelar']").IsEnabled = True
Repetir 로 텍스트가있는 요소 :
xpath 사용 :
Do While bot.FindElementByXPath("//span[@class='ui-button-text' and text()='Repetir']").IsEnabled = True
텍스트가 Aceptar 인 요소 :
xpath 사용 :
Do While bot.FindElementByXPath("//span[@class='ui-button-text' and text()='Aceptar']").IsEnabled = True
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다