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'm not sure why id=count didn't work. It's possible there's some weird interaction with the yt-view-count-renderer tag. I tested the CSS selector, `span.view-count` and it works just fine.

BTW, you can test your CSS selectors in the devtools in Chrome using `$$()`, e.g. `$$("span.view-count")`. `$$()` is sorta the equivalent of `driver.find_elements_by_css_selector()`.

For more details on this and other commands you can use the devtools, see [this link](https://developers.google.com/web/tools/chrome-devtools/console/command-line-reference).