Question: I am trying to scrape youtube views from any video links. I tried catching elements using selenium driver but for some reason i cannot catch it.Below is the code i have used: 

```
driver=webdriver.chrome()
driver.get("https://www.youtube.com/watch?v=F-eMt3SrfFU")
driver.find_element_by_id("count").text
driver.find_element_by_id("watch-view-count").text

```

i cannot catch elements on this link. am i doing something wrong here ?
it is a youtube movie link and i want to get the view on the link

Answer: 
It may be the case after get() elements won't be available instantly. You can use waits like following example.

```
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC

driver=webdriver.chrome()
driver.get("https://www.youtube.com/watch?v=F-eMt3SrfFU")
element = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.ID, "count"))) # 10 seconds implicit wait
print element.text 

```
I would suggest you to get a bit granular and instead of targeting the node with `id("count")` we can target the innerHTML i.e. the `<span>` tag as follows:

```
from selenium import webdriver

driver=webdriver.Chrome(executable_path=r'C:\Utility\BrowserDrivers\chromedriver.exe')
driver.get("https://www.youtube.com/watch?v=F-eMt3SrfFU")
my_views = driver.find_element_by_xpath("//span[@class='view-count style-scope yt-view-count-renderer']").text
print(my_views)

```