python selenium:元素点击被拦截:元素在

时间:2021-01-13 02:15:57

标签: python selenium

我想从 textFile 使用 brutForce 密码,一切似乎都在工作,但仍然有问题:

  def tryToLogin(self):       
        self.driver.get('{}/accounts/login/'.format(self.base_url))
        time.sleep(2)
        self.driver.find_element_by_xpath("//button[contains(text(),'Accept')]").click()
        self.driver.find_element_by_name('username').send_keys(self.username)       
        for line in self.pswFile:
            line = line.strip('\n')
            WebDriverWait(self.driver, 10).until(EC.presence_of_element_located((By.NAME, 'password'))).click()
            self.driver.execute_script('arguments[0].value = "";', self.driver.find_element_by_name('password'))
            WebDriverWait(self.driver, 10).until(EC.presence_of_element_located((By.NAME, 'password'))).send_keys(line)
#Login button:
            WebDriverWait(self.driver, 10).until(EC.presence_of_element_located((By.XPATH, '//*[@id="loginForm"]/div'
                                                                                           '/div[3]/button'))).click()
            time.sleep(2)

我收到此错误:

   selenium.common.exceptions.ElementClickInterceptedException: Message: element click intercepted: Element <button class="sqdOP  L3NKy   y3zKF     " type="submit" disabled="">...<
/button> is not clickable at point (509, 265). Other element would receive the click: <div class="                     Igw0E     IwRSH      eGOV_         _4EzTm    bkEs3
                  CovQj                  jKUp7          DhRcB                                                    ">...</div>
  (Session info: chrome=87.0.4280.141)

为什么会这样?

0 个答案:

没有答案
相关问题