Yo, Selenium scraping YouTube is a pain, but here's what worked for me:
Try using `WebDriverWait` with `EC.presence_of_element_located` for lazy-loaded content. Also, scroll the page manually with `driver.execute_script("window.scrollBy(0, 500)")` to trigger video loads.
For comments, I had to add a delay before scraping—sometimes up to 5 secs. Shadow DOM isn’t too bad if you use `driver.execute_script` to dig into it.
Captchas? Yeah, you’re screwed. Maybe rotate IPs or use a service like 2Captcha.
Try using `WebDriverWait` with `EC.presence_of_element_located` for lazy-loaded content. Also, scroll the page manually with `driver.execute_script("window.scrollBy(0, 500)")` to trigger video loads.
For comments, I had to add a delay before scraping—sometimes up to 5 secs. Shadow DOM isn’t too bad if you use `driver.execute_script` to dig into it.
Captchas? Yeah, you’re screwed. Maybe rotate IPs or use a service like 2Captcha.
