'Nothing happens when I click on an element The code runs without error and I find the desired element But it did not click on the part I want

def check_follow_back(page,name_my_page):
driver.get(f'https://www.instagram.com/{page}/')
time.sleep(2.5)
try :
    driver.find_element_by_class_name('_7UhW9    vy6Bb     MMzan   KV-D4           uL8Hv        T0kll ').click()
except:
    try:
        driver.find_element_by_class_name('div._7UhW9    vy6Bb     MMzan   KV-D4           uL8Hv        T0kll ').click()
    except:
        driver.find_element_by_xpath('//div[@class="_7UhW9    vy6Bb     MMzan   KV-D4           uL8Hv        T0kll "]').click()
print('click')

Here I tried to click on the part of Instagram that shows my following and after run Is shown print on terminal and it did not click on the part I want



Solution 1:[1]

The code doesn't have problems, but you never call your function.

Try to add:

func = check_follow_back(page,name_my_page)

with proper parameters

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Pitermaniak