The page uses js to load the content dymanically. Mechanize simply cannot handle it. You have two options here:
- try to simulate those js calls manually in the script
- switch to in-browser tools like selenium
Here's the same sample using selenium
:
import selenium.webdriver as webdriver
url = "http://www.youtube.com/watch?v=OuSdU8tbcHY"
driver = webdriver.Firefox()
driver.get(url)
embed = driver.find_elements_by_tag_name('embed')[0]
print embed
Hope that helps.