Skip to content

Instantly share code, notes, and snippets.

@shubham-singh-ss
Created May 31, 2019 05:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shubham-singh-ss/e3a33116b7055246d8c44d50c52d866c to your computer and use it in GitHub Desktop.
Save shubham-singh-ss/e3a33116b7055246d8c44d50c52d866c to your computer and use it in GitHub Desktop.
wait = WebDriverWait(driver, 10)
v_category = "CATEGORY_NAME"
for x in links:
           driver.get(x)
           v_id = x.strip('https://www.youtube.com/watch?v=')
           v_title = wait.until(EC.presence_of_element_located(
                          (By.CSS_SELECTOR,"h1.title yt-formatted-string"))).text
           v_description =  wait.until(EC.presence_of_element_located(
                                        (By.CSS_SELECTOR,"div#description
                                         yt-formatted-string"))).text
           df.loc[len(df)] = [v_id, v_title, v_description, v_category]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment