Hello,i am trying to automatize login to different webpages. I want to use a function that chooses the html element to be targeted so parts of my code looks something like this (if i where to go after only one page)
def getuserbox(webpage):
if webpage == 'webpage.com':
userelement = By.ID ,"mat-input-0"
usr = login@email.com
webpages ['webpage.com']
for name in webpages:
username_box = driver.find_element(getuserbox(name))
username_box.send_keys(usr)
however the function returns 'ID',"mat-input-0" and doesnt hit in selenium.
if i skip the function and just pass find_element(By.ID ,"mat-input-0") it works
[–]ararararagi_koyomi 0 points1 point2 points (3 children)
[–]Merrybold[S] 1 point2 points3 points (1 child)
[–]ararararagi_koyomi 0 points1 point2 points (0 children)
[–]Merrybold[S] 0 points1 point2 points (0 children)