Quantcast
Channel: Active questions tagged selenium - Stack Overflow
Viewing all articles
Browse latest Browse all 97813

Python Selenium - I can't run the while loop

$
0
0

I just started python. I want to write a loop containing bot using Selenium. I want to login to a site. I send my number and password. The page refreshes when there is density on the server. Number and password sections are being cleaned. I want it to try to login with the same number and password until I log in to the system. If I enter text in the number section, the loop works, but I need to enter a number.

from selenium import webdriver
import time
browser = webdriver.Chrome()
browser.get("https://www.*****.com")
time.sleep(1)

loginbutton = browser.find_element_by_name('login')
no = browser.find_element_by_name('no')
password = browser.find_element_by_name('pass')

while True:
    no.send_keys("160210051")
    password.send_keys("example")
    time.sleep(1)

    loginbutton.click()
    no.clear()
    password.clear()
    continue

python shell, error descripton


Viewing all articles
Browse latest Browse all 97813

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>