Has anyone tried Selenium scraping YouTube? Need tips for handling dynamic content! or Is Selenium sc

18 Replies, 759 Views

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.

Messages In This Thread



Users browsing this thread: 1 Guest(s)