I want to search for a specific keyword and then scrape all the videos URLs.
I know the code I am about to paste is not going to do that, but I want to show what I have done.
chrome_path = r"C:\Users\Admin\Documents\chromedriver\chromedriver.exe"
driver = webdriver.Chrome(chrome_path)
driver.get("https://www.youtube.com/results?sp=CAISAggBUBQ%253D&q=minecraft")
links = driver.find_elements_by_partial_link_text('/watch')
for link in links:
links = (links.get_attribute("href"))
How can I scrape the links and save them to a file?