Created
October 7, 2020 21:30
-
-
Save francoisstamant/726890c56b074f0de9d21c3e229970c9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data=[] | |
with Chrome(executable_path=r'C:\Program Files\chromedriver.exe') as driver: | |
wait = WebDriverWait(driver,15) | |
driver.get("https://www.youtube.com/watch?v=kuhhT_cBtFU&t=2s") | |
for item in range(200): | |
wait.until(EC.visibility_of_element_located((By.TAG_NAME, "body"))).send_keys(Keys.END) | |
time.sleep(15) | |
for comment in wait.until(EC.presence_of_all_elements_located((By.CSS_SELECTOR, "#content"))): | |
data.append(comment.text) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
hi, i am a beginner in python and coding, would you mind to share/ add the code on how i can extract the Youtube usernames of the comments as well please?