I'm trying to scrape a really long Spotify playlist (10,000 songs), when I tried using beautiful soup I found out I could find only 100 links. I found out that some websites load the objects dynamically so I had to use "selenium".
The problem is that I still don't understand how to get the "changing HTML", I found out that the source code is changing when I scroll to show different parts of the playlist. How do I get all of the 10,000 song links?
BIG_PLAYLIST_URL = 'https://open.spotify.com/playlist/2owshwciXFj8pnZElRlJqG?si=cf026ba736f64271'
driver = webdriver.Chrome()
driver.get(BIG_PLAYLIST_URL)
xpath = '//*[@id="main"]/div/div[2]/div[3]/div[1]/div[2]/div[2]/div/div/div[2]/main/div/section/div[2]/div[3]/div/div[2]/div[2]/div[12]'
mainDiv = driver.find_element(by=By.XPATH, value=xpath)
divs = mainDiv.find_elements(by=By.CSS_SELECTOR, value="div")
print(len(divs))