Can I use CDP instead of UC mode? #4014
              
  
  Closed
              
          
                  
                    
                      Eduardo-Qinttus
                    
                  
                
                  started this conversation in
                General
              
            Replies: 1 comment
-
| I just clicked on the second iframe and it worked | 
Beta Was this translation helpful? Give feedback.
                  
                    0 replies
                  
                
            
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
Uh oh!
There was an error while loading. Please reload this page.
-
This method was working until today when it was detected as a robot. Please ignore my noob skills. I'm not using cpd because it has two iframes.
def check_box(self, sb):
try:
sb.reconnect()
try:
sb.switch_to_frame( '#frmApp' )
sleep(0.5)
sb.switch_to_frame( '#conteudo-pagina > div.h-captcha > iframe' )
sleep(0.5)
except:
sb.switch_to_default_content()
sb.switch_to_frame( 'iframe' )
if sb.is_element_visible( '#checkbox' ):
sleep(0.5)
sb.click( '#checkbox' )
sleep(3)
sb.switch_to_default_content()
sb.switch_to_frame( '#frmApp' )
sleep(0.5)
sb.click( 'a:contains("Prosseguir")' )
while True:
sleep(5)
if sb.is_element_visible( '#ctl00_cphConteudo_PnlMensagem_lblMensagem' ):
sb.refresh_page()
sleep( 4.5 )
sb.switch_to_frame( '#frmApp' )
sleep(0.5)
sb.switch_to_frame( '#conteudo-pagina > div.h-captcha > iframe' )
sleep(0.5)
sb.click('#checkbox')
sleep(0.5)
sb.switch_to_default_content()
sb.switch_to_frame( 'iframe' )
sb.click( 'a:contains("Prosseguir")' )
else:
sb.switch_to_default_content()
sb.switch_to_frame( 'iframe' )
sb.click( 'a:contains("Prosseguir")' )
break
else:
sb.switch_to_default_content()
sb.switch_to_frame( 'iframe' )
except Exception as e:
pass
sb.disconnect()
Beta Was this translation helpful? Give feedback.
All reactions