I am trying to create a function that takes a search term from a list and add it to a list of links.
formatted_link = link_to_vid.replace(' ', '+')
driver.get('https://www.youtube.com/results?search_query={}'.format(str(formatted_link)))
Then extracts the first link that YouTube returns. For example, I search 'Never Gonna Give You Up' and it adds the link of the first result to a list.
Then I may want to do ['Never Gonna Give You Up', 'Shrek']
How would I do this without actually clicking on the link?