Skip to content

Instantly share code, notes, and snippets.

@maddada
Created January 10, 2026 19:53
Show Gist options
  • Select an option

  • Save maddada/3682924780ea28767c5eeb49e1c0c6ed to your computer and use it in GitHub Desktop.

Select an option

Save maddada/3682924780ea28767c5eeb49e1c0c6ed to your computer and use it in GitHub Desktop.
full conversations claude in chrome vs playwriter
▐▛███▜▌ Claude Code v2.1.3
▝▜█████▛▘ Opus 4.5 · Claude Max
▘▘ ▝▝ /Users/madda
❯ /clear
⎿  (no content)
❯ go to google image search, search for potato, grab the link to the first
image in that page and get me the console logs of the page. use
playwriter
⏺ I'll use playwriter to navigate to Google Images, search for "potato", get the first image link, and retrieve console logs.
⏺ playwriter - execute (MCP)(code: "await
page.goto('https://images.google.com'); await
page.waitForLoadState('load'); console.log('url:',
page.url()); console.log(await
accessibilitySnapshot({ page }).then(x =>
x.split('\\n').slice(0, 40).join('\\n')));",
timeout: 15000)
⎿  Console output:
[log] url: https://images.google.com/
[log] {
… +31 lines (ctrl+o to expand)
⏺ Good, I'm on Google Images. Let me search for "potato".
⏺ playwriter - execute (MCP)(code: "await
page.locator('aria-ref=e44').fill('potato'); await
page.locator('aria-ref=e55').click(); await
page.waitForLoadState('networkidle');
console.log('url:', page.url());", timeout: 15000)
⎿  Error: Error executing code: Code execution timed out after 15000ms
CodeExecutionTimeoutError: Code execution timed out after 15000ms
at Timeout._onTimeout (file:///Users/madda/.npm/_npx/6b069a0882e32249/no
de_modules/playwriter/dist/mcp.js:733:64)
at listOnTimeout (node:internal/timers:588:17)
at process.processTimers (node:internal/timers:523:7)
⏺ Let me check the current state and try a different approach.
⏺ playwriter - execute (MCP)(code: "console.log('url:', page.url());
console.log(await accessibilitySnapshot({ page,
search: /image|img|potato/i }).then(x => x.slice(0,
3000)));", timeout: 10000)
⎿ Console output:
[log] url:
https://www.google.com/search?q=potato&newwindow=1&sca_esv=3
1db8cbb946c4eae&sxsrf=ANbL-n4wJGenyT45diDW3Ztn_ERezkKeAw:1768074344042
&
… +49 lines (ctrl+o to expand)
⏺ Good, I'm on the search results page. Let me find the first image and get its link.
⏺ playwriter - execute (MCP)(code: "await screenshotWithAccessibilityLabels({
page });", timeout: 20000)
⎿ Code executed successfully (no output)
Screenshot saved to:
/Users/madda/tmp/playwriter-screenshot-17680743844
15-vuxn.jpg
… +119 lines (ctrl+o to expand)
⎿  [Image]
⏺ I can see the image search results. The first image is from Veggipedia (ref e388). Let me click on it to get the actual image URL.
⏺ playwriter - execute (MCP)(code: "await page.locator('aria-ref=e388').click();
await page.waitForLoadState('networkidle',
{timeout: 5000}).catch(() => {}); console.log(await
accessibilitySnapshot({ page, search:
/image|img|src|jpg|png|webp/i }).then(x =>
x.slice(0, 4000)));", timeout: 15000)
⎿ Console output:
[log] {
"full": "- generic [ref=e1]:\n - heading \"Accessibility links\"
[le
… +56 lines (ctrl+o to expand)
⏺ Let me take a screenshot to see the expanded view and find the image URL.
⏺ playwriter - execute (MCP)(code: "await screenshotWithAccessibilityLabels({
page });", timeout: 20000)
⎿ Code executed successfully (no output)
Screenshot saved to:
/Users/madda/tmp/playwriter-screenshot-17680744148
38-51e2.jpg
… +119 lines (ctrl+o to expand)
⎿  [Image]
⏺ The panel didn't open. Let me use JavaScript to extract the image URL directly from the first image result.
⏺ playwriter - execute (MCP)(code: "const firstImageLink = await
page.evaluate(() => { const imgs =
document.querySelectorAll('img[data-src],
img[src]'); for (const img of imgs) { const src =
img.getAttribute('data-src') || img.src; if (src &&
(src.includes('http') && !src.includes('google') &&
!src.includes('gstatic'))) { return src; } } return
null; }); console.log('First non-Google image src:',
firstImageLink);", timeout: 10000)
⎿  Console output:
[log] First non-Google image src: null
⏺ Let me try clicking directly on the first image thumbnail and look for the panel that opens.
⏺ playwriter - execute (MCP)(code: "const firstImage = await
page.locator('div[data-q=\"potato\"] img').first();
await firstImage.click({force: true}); await
page.waitForTimeout(1500); console.log(await
accessibilitySnapshot({ page, search:
/visit|view|veggipedia/i }));", timeout: 10000)
⎿ Console output:
[log] {
"full": "- generic [ref=e1]:\n - heading \"Accessibility links\"
[le
… +87 lines (ctrl+o to expand)
⏺ Let me try using JavaScript to extract the image data from Google's embedded data structures.
⏺ playwriter - execute (MCP)(code: "const imageData = await page.evaluate(() =>
{ const results = []; const divs =
document.querySelectorAll('[data-lpage]');
divs.forEach((div, i) => { if (i < 3) {
results.push({ pageUrl:
div.getAttribute('data-lpage'), title:
div.querySelector('h3')?.textContent }); } });
return results; }); console.log('Image data:',
JSON.stringify(imageData, null, 2));", timeout:
10000)
⎿  Console output:
[log] Image data: [
{
… +13 lines (ctrl+o to expand)
⏺ I found the page URLs. Let me now extract the actual image URLs from the results.
⏺ playwriter - execute (MCP)(code: "const imageUrls = await page.evaluate(() =>
{ const results = []; const images =
document.querySelectorAll('g-img img');
images.forEach((img, i) => { if (i < 5) { const src
= img.src || img.getAttribute('data-src'); if (src
&& src.startsWith('http')) { results.push({index: i,
src: src.substring(0, 200)}); } } }); const allImgs
= document.querySelectorAll('img[src*=\"encrypted\"
]'); allImgs.forEach((img, i) => { if (i < 3)
results.push({type: 'encrypted', src:
img.src.substring(0, 200)}); }); return results; });
console.log(JSON.stringify(imageUrls, null, 2));",
timeout: 10000)
⎿  Console output:
[log] [
{
… +15 lines (ctrl+o to expand)
⏺ Those are Google's thumbnail URLs. Let me click on the first image to get the original full image URL.
⏺ playwriter - execute (MCP)(code: "await
page.locator('[data-lpage=\"https://www.veggipedia.n
l/en/fruits-and-vegetables/potatoes\"]').click();
await page.waitForTimeout(2000); await
screenshotWithAccessibilityLabels({ page });",
timeout: 20000)
⎿ Code executed successfully (no output)
Screenshot saved to:
/Users/madda/tmp/playwriter-screenshot-17680744661
48-ujbv.jpg
… +119 lines (ctrl+o to expand)
⎿  [Image]
⏺ The panel is now open showing the first image. Let me extract the full image URL from the panel.
⏺ playwriter - execute (MCP)(code: "const fullImageUrl = await page.evaluate(()
=> { const panelImg =
document.querySelector('img[jsname=\"kn3ccd\"]') ||
document.querySelector('img[data-atf=\"4\"]') ||
document.querySelector('[data-icsrc]'); if
(panelImg) { return panelImg.src ||
panelImg.getAttribute('data-icsrc'); } const
largeImgs = Array.from(document.querySelectorAll('im
g')).filter(img => img.width > 300 &&
img.src.startsWith('http')); return
largeImgs[0]?.src; }); console.log('Full image
URL:', fullImageUrl);", timeout: 10000)
⎿ Console output:
[log] Full image URL:
https://www.veggipedia.nl/_next/image?url=https%3
A%2F%2Fveggipedia-cms.production.taks.zooma.cloud%2Fassets%2FUploads%2
F
… +2 lines (ctrl+o to expand)
⏺ I found the image URL. Now let me get the console logs from the page.
⏺ playwriter - execute (MCP)(code: "const logs = await getLatestLogs({ page,
count: 50 }); console.log('Console logs from the
page:'); console.log(logs);", timeout: 10000)
⎿  Console output:
[log] Console logs from the page:
[log] []
⏺ The page doesn't have console logs (Google tends to be quiet on console output). Let me check for any errors or other log types.
⏺ playwriter - execute (MCP)(code: "const allLogs = await getLatestLogs({ count:
100 }); console.log('All captured logs:',
allLogs.length > 0 ? allLogs : 'No console logs
captured on this page');
page.removeAllListeners();", timeout: 10000)
⎿  Console output:
[log] All captured logs: [
"[debug] [VSC] Content script initialized",
… +2 lines (ctrl+o to expand)
⏺ Summary: Retrieved first potato image URL and console logs from Google Images.
Here are the results:
First Image Link:
https://www.veggipedia.nl/_next/image?url=https%3A%2F%2Fveggipedia-cms.production.taks.zooma.cloud%2Fassets%2FUploads%2FProducts%2FAardappel-groenten-Veggipedia__FitMaxWzYwMCw2MDBd.png&w=3840&q=75
This image is from Veggipedia - Potatoes (the first result in the Google Images search).
Console Logs:
The Google Images page itself has no console output. The only captured logs were:
[debug] [VSC] Content script initialized
[debug] [VSC] Content script initialized
These are from a VS Code extension running in your browser, not from the Google Images page itself. Google's pages are typically silent on console logging.
✻ Worked for 2m 44s
========
▐▛███▜▌ Claude Code v2.1.3
▝▜█████▛▘ Opus 4.5 · Claude Max
▘▘ ▝▝ /Users/madda
❯ go to google image search, search for potato, grab the link to the first
image in that page and get me the console logs of the page. use
playwriter
⏺ I'll help you with that using Playwriter. Let me start by navigating to Google Images and searching for "potato".
⏺ playwriter - execute (MCP)(code: "await
page.goto('https://www.google.com/imghp'); await
page.waitForLoadState('load'); console.log('url:',
page.url()); console.log(await
accessibilitySnapshot({ page }).then(x =>
x.split('\\n').slice(0, 30).join('\\n')));",
timeout: 15000)
⎿  Console output:
[log] url: https://www.google.com/imghp
[log] {
… +31 lines (ctrl+o to expand)
⏺ Good, I'm on Google Images. Now let me search for "potato".
⏺ playwriter - execute (MCP)(code: "await
page.locator('aria-ref=e44').fill('potato'); await
page.locator('aria-ref=e55').click(); await
page.waitForLoadState('load'); console.log('url:',
page.url());", timeout: 15000)
⎿ Console output:
[log] url:
https://www.google.com/search?q=potato&newwindow=1&sca_esv=3
1db8cbb946c4eae&sxsrf=ANbL-n46pK9x0RG9iRUZfDhQheacDG0w3w:1768073800863
&
… +5 lines (ctrl+o to expand)
⏺ Good, I'm on the image search results. Let me get the accessibility snapshot to find the first image.
⏺ playwriter - execute (MCP)(code: "const snapshot = await
accessibilitySnapshot({ page, search: /img|image/i
}); console.log(snapshot);", timeout: 10000)
⎿ Console output:
[log] {
"full": "- generic [active] [ref=e1]:\n - heading \"Accessibility
li
… +87 lines (ctrl+o to expand)
⏺ Let me get a better view of the image results.
⏺ playwriter - execute (MCP)(code: "await screenshotWithAccessibilityLabels({
page });", timeout: 20000)
⎿ Code executed successfully (no output)
Screenshot saved to:
/Users/madda/tmp/playwriter-screenshot-17680738278
64-zcbw.jpg
… +119 lines (ctrl+o to expand)
⎿  [Image]
⏺ I can see the image search results. The first image is "Veggipedia - Potatoes" (ref e388). Let me click on it to get the actual image link.
⏺ playwriter - execute (MCP)(code: "await page.locator('aria-ref=e388').click();
await page.waitForLoadState('networkidle',
{timeout: 5000}).catch(() => {});
console.log('url:', page.url()); console.log(await
accessibilitySnapshot({ page, search:
/img.*src|image|jpg|png|webp/i }));", timeout:
15000)
⎿ Console output:
[log] url:
https://www.google.com/search?q=potato&newwindow=1&sca_esv=3
1db8cbb946c4eae&sxsrf=ANbL-n46pK9x0RG9iRUZfDhQheacDG0w3w:1768073800863
&
… +87 lines (ctrl+o to expand)
⏺ Let me take a screenshot to see the image panel that opened.
⏺ playwriter - execute (MCP)(code: "await screenshotWithAccessibilityLabels({
page });", timeout: 20000)
⎿ Code executed successfully (no output)
Screenshot saved to:
/Users/madda/tmp/playwriter-screenshot-17680738600
02-wdn1.jpg
… +119 lines (ctrl+o to expand)
⎿  [Image]
⏺ The panel didn't open. Let me use JavaScript to extract the first image's source URL and get the console logs.
⏺ playwriter - execute (MCP)(code: "const firstImageUrl = await page.evaluate(()
=> { const imgs =
document.querySelectorAll('img[data-src],
img[src]'); for (const img of imgs) { const src =
img.getAttribute('data-src') || img.src; if (src &&
src.includes('encrypted-tbn') || (src &&
!src.startsWith('data:') && !src.includes('google')
&& !src.includes('gstatic'))) { return src; } }
return null; }); console.log('First image URL:',
firstImageUrl);", timeout: 10000)
⎿ Console output:
[log] First image URL:
https://encrypted-tbn0.gstatic.com/images?q=tbn:
ANd9GcRCUjd2kCylYZfD9bFYRs0nWwszdxAAPFUP_XVYzvVV2__ssLjDUzvh0JMF&s
⏺ That's just a thumbnail. Let me click on the first image properly to get the actual source image URL, then get the console logs.
⏺ playwriter - execute (MCP)(code: "await
page.locator('[data-id]').first().click(); await
page.waitForTimeout(1500); await
screenshotWithAccessibilityLabels({ page });",
timeout: 20000)
⎿ Code executed successfully (no output)
Screenshot saved to:
/Users/madda/tmp/playwriter-screenshot-17680738879
26-8o6a.jpg
… +118 lines (ctrl+o to expand)
⎿  [Image]
⏺ It accidentally triggered a search for "transparent potato". Let me go back to the potato search and click properly on the first image result.
⏺ playwriter - execute (MCP)(code: "await page.goto('https://www.google.com/sear
ch?q=potato&tbm=isch'); await
page.waitForLoadState('load'); await
page.waitForTimeout(1000); await
screenshotWithAccessibilityLabels({ page });",
timeout: 20000)
⎿ Code executed successfully (no output)
Screenshot saved to:
/Users/madda/tmp/playwriter-screenshot-17680739100
22-31w4.jpg
… +120 lines (ctrl+o to expand)
⎿  [Image]
⏺ Now let me click on the first image (e382 - the Veggipedia potatoes image) to open the details panel.
⏺ playwriter - execute (MCP)(code: "await page.locator('aria-ref=e382').click();
await page.waitForTimeout(2000); await
screenshotWithAccessibilityLabels({ page });",
timeout: 20000)
⎿ Code executed successfully (no output)
Screenshot saved to:
/Users/madda/tmp/playwriter-screenshot-17680739335
23-5p3e.jpg
… +121 lines (ctrl+o to expand)
⎿  [Image]
⏺ The image panel is now open. I can see "Veggipedia - Potatoes" in the side panel. Let me extract the actual image URL and get the console logs.
⏺ playwriter - execute (MCP)(code: "const imageUrl = await page.evaluate(() => {
const panel =
document.querySelector('[jsname=\"CGzTgf\"]') ||
document.querySelector('[data-hveid]'); const imgs =
document.querySelectorAll('img'); for (const img of
imgs) { if (img.src &&
img.src.includes('veggipedia') || (img.naturalWidth
> 300 && !img.src.includes('gstatic') &&
!img.src.includes('google'))) { return img.src; } }
const largeImg = Array.from(imgs).find(img =>
img.width > 400 && img.height > 300); return
largeImg ? largeImg.src : null; });
console.log('First image URL:', imageUrl);",
timeout: 10000)
⎿ Console output:
[log] First image URL:
data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABA
AD/2wCEAAkGBxMTEhMTExIVFhUXGBgXFxgYFxgYGBgXFxcXGhcXFRUYHSggGBolHxUaIjE
h
… +86 lines (ctrl+o to expand)
⏺ That returned a base64 data URL. Let me extract the actual source image URL from the page and then get the console logs.
⏺ playwriter - execute (MCP)(code: "const sourceUrl = await page.evaluate(() =>
{ const anchors =
document.querySelectorAll('a[href*=\"imgurl=\"]');
for (const a of anchors) { const match =
a.href.match(/imgurl=([^&]+)/); if (match) return
decodeURIComponent(match[1]); } const visitLink =
document.querySelector('a[href*=\"veggipedia\"]');
if (visitLink) return visitLink.href; return null;
}); console.log('Source image URL:', sourceUrl);",
timeout: 10000)
⎿ Console output:
[log] Source image URL:
https://www.veggipedia.nl/_next/image?url=https
%3A%2F%2Fveggipedia-cms.production.taks.zooma.cloud%2Fassets%2FUploads
%
… +2 lines (ctrl+o to expand)
⏺ I got the image URL. Now let me get the console logs.
⏺ playwriter - execute (MCP)(code: "const logs = await getLatestLogs({ page,
count: 100 }); console.log('Console logs:', logs);",
timeout: 10000)
⎿  Console output:
[log] Console logs: []
⏺ The console logs appear to be empty. Let me scroll/interact with the page to trigger any lazy-loaded content and capture any logs that might appear.
⏺ playwriter - execute (MCP)(code: "await page.evaluate(() => {
window.scrollBy(0, 500); }); await
page.waitForTimeout(1000); const allLogs = await
getLatestLogs({ page, count: 200 });
console.log('All console logs after scroll:',
allLogs.length > 0 ? allLogs : 'No console logs
captured');", timeout: 10000)
⎿  Console output:
[log] All console logs after scroll: No console logs captured
⏺ Google Images appears to not produce visible console logs. Let me clean up and provide you with the results.
⏺ playwriter - execute (MCP)(code: "page.removeAllListeners(); console.log('Done
- cleaned up listeners');", timeout: 5000)
⎿  Console output:
[log] Done - cleaned up listeners
⏺ Summary: Searched Google Images for "potato" and retrieved the first image link. Console logs were empty.
Results:
First Image Link (Veggipedia - Potatoes):
https://www.veggipedia.nl/_next/image?url=https%3A%2F%2Fveggipedia-cms.production.taks.zooma.cloud%2Fassets%2FUploads%2FProducts%2FAardappel-groenten-Veggipedia__FitMaxWzYwMCw2MDBd.png&w=3840&q=75
Console Logs:
The Google Images page did not produce any console logs. Google's pages are typically optimized for production and suppress console output.
✻ Sautéed for 3m 3s
========
▐▛███▜▌ Claude Code v2.1.3
▝▜█████▛▘ Opus 4.5 · Claude Max
▘▘ ▝▝ /Users/madda
❯ /mcp
⎿ MCP dialog dismissed
❯ go to google image search, search for potato, grab the link to the first
image in that page and get me the console logs of the page. use claude in
chrom
⏺ I'll help you with that. Let me first get the browser tab context.
⏺ Claude in Chrome[tabs_context_mcp]
⎿  Tabs read
⏺ I have a tab. Let me navigate to Google Images and search for potato.
⏺ Claude in Chrome[navigate](www.google.com) [View Tab]
⎿  Navigation completed
⏺ Claude in Chrome[computer](screenshot) [View Tab]
⎿  Action completed
⏺ Google Images is loaded. Let me click on the search box and type "potato".
⏺ Claude in Chrome[computer](left_click at (784, 327)) [View Tab]
⎿  Action completed
⏺ Claude in Chrome[computer](type "potato") [View Tab]
⎿  Action completed
⏺ Claude in Chrome[computer](key Return) [View Tab]
⎿  Action completed
⏺ Claude in Chrome[computer](wait 2s) [View Tab]
⎿  Action completed
⏺ Claude in Chrome[computer](screenshot) [View Tab]
⎿  Action completed
⏺ I can see the image search results. Let me click on the first image (from Veggipedia) to get its link.
⏺ Claude in Chrome[computer](left_click at (100, 257)) [View Tab]
⎿  Action completed
⏺ Claude in Chrome[computer](screenshot) [View Tab]
⎿  Action completed
⏺ I can see the image panel expanded. Let me extract the image URL using JavaScript and also get the console logs.
⏺ Claude in Chrome[javascript_tool] [View Tab]
⎿  Script executed
⏺ Let me use read_page to find the image link in the DOM structure.
⏺ Claude in Chrome[read_page] [View Tab]
⎿  Page read
⏺ I found the image link in the DOM. Let me extract and decode it, then get the console logs.
⏺ Claude in Chrome[javascript_tool] [View Tab]
⎿  Script executed
⎿  Console messages retrieved
⏺ Summary: Retrieved the first potato image link and console logs from Google Images.
Here's what I found:
First Image URL (from Veggipedia):
https://www.veggipedia.nl/_next/image?url=https%3A%2F%2Fveggipedia-cms.production.taks.zooma.cloud%2Fassets%2FUploads%2FProducts%2FAardappel-groenten-Veggipedia__FitMaxWzYwMCw2MDBd.png&w=3840&q=75
Source Page:
https://www.veggipedia.nl/en/fruits-and-vegetables/potatoes
Console Logs:
The page only has 2 console messages, both from a browser extension:
[1] [11:41:16 PM] [DEBUG] [VSC] Content script initialized
[2] [11:41:20 PM] [DEBUG] [VSC] Content script initialized
The Google Images page itself doesn't generate much console output - just the VSCode extension content script initialization logs. There are no errors or warnings from the page.
✻ Sautéed for 1m 46s
==========
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment