Reputation: 115
mins = WebDriverWait(browser, 30).until(EC.visibility_of_element_located((By.NAME, "yt_min")))
browser.execute_script("arguments[0].setAttribute('value', '20');", mins)
I want it to change it to a random number in a specific range instead of 20, I know the randint method but I don't know how to approach it since it's a string
Upvotes: 1
Views: 112
Reputation: 122
import random
A = random.randint(range here)
mins = WebDriverWait(browser, 30).until(EC.visibility_of_element_located((By.NAME, "yt_min")))
browser.execute_script("arguments[0].setAttribute('value', f'{str(A)}');", mins)
Upvotes: 1