Automate NotebookLM notebook creation from YouTube videos with automatic research and Audio Overview generation.
Screenshot before every action — verify UI state, identify correct elements, confirm success.
text
📸 Screenshot → 👀 Analyze → 🎯 Target → ✅ Verify → 🖱️ Execute → 📸 Screenshot → ✓ Confirm
python
# 1. Get video info
Control Chrome:open_url("https://www.youtube.com/watch?v=VIDEO_ID")
Control Chrome:get_page_content()
# 2. Research people mentioned
web_search("[Person Name] background career")
# 3. Create research document (keep under 500k chars)
python
# 1. Navigate
Control Chrome:open_url("https://notebooklm.google.com/")
# 2. Create notebook
# Click "Create new" button
# 3. Add YouTube source
# Click "Websites" → Enter URL → Click "Insert"
# 4. Add research document
# Click "Add sources" → "Copied text" → Paste content → Click "Insert"
# 5. Generate audio
# Click "Audio Overview" in Studio panel
NotebookLM has multiple textareas. Generic selectors grab the wrong one!
text
SIDEBAR (wrong) CENTER MODAL (correct)
┌──────────────┐ ┌──────────────────┐
│ Search box │ │ URL/Text input │
│ query-input │ │ "Paste any links"|
└──────────────┘ └──────────────────┘
ElementSelectorURL inputtextarea[placeholder="Paste any links"]Text inputtextarea[placeholder="Paste text here"]Sidebar (AVOID)textarea[placeholder*="Search"]
javascript
// Simple .value = doesn't work! Use this:
var setter = Object.getOwnPropertyDescriptor(
HTMLTextAreaElement.prototype, 'value'
).set;
setter.call(textarea, 'content');
textarea.dispatchEvent(new Event('input', {bubbles: true}));
textarea.dispatchEvent(new Event('change', {bubbles: true}));
javascript
var btn = document.querySelector('button');
if (btn && !btn.disabled && !btn.className.includes('disabled')) {
btn.click();
}
javascript
var urlTextarea = document.querySelector('textarea[placeholder="Paste any links"]');
if (urlTextarea) {
var setter = Object.getOwnPropertyDescriptor(
HTMLTextAreaElement.prototype, 'value'
).set;
setter.call(urlTextarea, 'https://www.youtube.com/watch?v=VIDEO_ID');
urlTextarea.dispatchEvent(new Event('input', {bubbles: true}));
urlTextarea.dispatchEvent(new Event('change', {bubbles: true}));
}
javascript
var pasteTextarea = document.querySelector('textarea[placeholder="Paste text here"]');
if (pasteTextarea) {
var setter = Object.getOwnPropertyDescriptor(
HTMLTextAreaElement.prototype, 'value'
).set;
setter.call(pasteTextarea, RESEARCH_CONTENT);
pasteTextarea.dispatchEvent(new Event('input', {bubbles: true}));
pasteTextarea.dispatchEvent(new Event('change', {bubbles: true}));
}
javascript
var buttons = Array.from(document.querySelectorAll('button'));
var btn = buttons.find(b => b.textContent.includes('Insert'));
if (btn && !btn.disabled) {
btn.click();
}
javascript
// Check what textareas exist
var textareas = Array.from(document.querySelectorAll('textarea'));
textareas.map(t => ({
placeholder: t.placeholder,
value: t.value.substring(0, 50)
}));
StepVerify BeforeVerify AfterNavigate-Home page loadedCreate notebookCreate button visibleNotebook openedAdd URLCorrect textarea identifiedURL in center, not sidebarClick InsertButton ENABLEDSource addedAdd textCorrect textarea identifiedText in center, not sidebarClick InsertButton ENABLED2 sources shownAudio OverviewStudio panel visibleGeneration started
❌ Don't✅ Dodocument.querySelector('textarea')``textarea[placeholder="Paste any links"]Click without checking stateVerify button enabled firstAssume action succeededScreenshot to confirmRush through stepsWait for async operations
ActionWaitPage navigation3sDialog open2sYouTube source processing8-10sText source processing5sAudio generation5-10 minutes
Wrong input targeted:
document.querySelectorAll('.query-input').forEach(el => el.value = '')Button disabled:
Modal didn't open: