I am trying to scrape a website using selenium. My goal is to give an input string like "youtube" and my script will go ahead and click the links in that website that contain that string or similar strings. To elaborate on that, if the input string is "youtube" but the link has a friendly name "Youtube" or "You.tube" or "Youtube Go", I want the script to select/click it.
I have tried to use
driver.find_element_by_link_text("youtube").click()
but it gives error for links that are not an exact match (its also case sensitive so even if the link is "Youtube" it will give error)
driver.find_element_by_partial_link_text("youtube").click()
but this also gives error and the only difference with the first option is if I provide a shorter input than the link name and even then, the shorter input needs to be an exact match with a part of the link name.
Any advice is much appreciated!