{"id":77487,"date":"2026-02-24T19:50:21","date_gmt":"2026-02-24T11:50:21","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/77487.html"},"modified":"2026-02-24T19:50:21","modified_gmt":"2026-02-24T11:50:21","slug":"%e9%81%bf%e5%bc%80%e8%bf%995%e4%b8%aa%e5%9d%91%ef%bc%81puppeteer-mcp%e6%9c%8d%e5%8a%a1%e5%99%a8%e8%b0%83%e8%af%95%e6%8c%87%e5%8d%97%ef%bc%88%e9%99%84%e5%b8%b8%e8%a7%81%e6%8a%a5%e9%94%99%e8%a7%a3","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/77487.html","title":{"rendered":"\u907f\u5f00\u8fd95\u4e2a\u5751\uff01Puppeteer MCP\u670d\u52a1\u5668\u8c03\u8bd5\u6307\u5357\uff08\u9644\u5e38\u89c1\u62a5\u9519\u89e3\u51b3\u65b9\u6848\uff09"},"content":{"rendered":"<h2>\u907f\u5f00\u8fd95\u4e2a\u5751&#xff01;Puppeteer MCP\u670d\u52a1\u5668\u8c03\u8bd5\u6307\u5357&#xff08;\u9644\u5e38\u89c1\u62a5\u9519\u89e3\u51b3\u65b9\u6848&#xff09;<\/h2>\n<p>\u8c03\u8bd5Puppeteer MCP\u670d\u52a1\u5668&#xff0c;\u5c31\u50cf\u662f\u5728\u4e00\u4e2a\u590d\u6742\u7684\u673a\u68b0\u8ff7\u5bab\u91cc\u5bfb\u627e\u90a3\u6839\u677e\u52a8\u7684\u87ba\u4e1d\u3002\u8868\u9762\u4e0a\u770b&#xff0c;\u4e00\u5207\u90fd\u5728\u8fd0\u884c\u2014\u2014\u6d4f\u89c8\u5668\u542f\u52a8\u4e86&#xff0c;\u5de5\u5177\u5217\u8868\u663e\u793a\u4e86&#xff0c;\u4f46\u5f53\u4f60\u6ee1\u6000\u671f\u5f85\u5730\u53d1\u9001\u7b2c\u4e00\u4e2a\u5bfc\u822a\u6307\u4ee4\u65f6&#xff0c;\u5374\u53ef\u80fd\u906d\u9047\u6d4f\u89c8\u5668\u7a97\u53e3\u4e00\u7247\u7a7a\u767d&#xff0c;\u6216\u8005\u63a7\u5236\u53f0\u7a81\u7136\u629b\u51fa\u4e00\u4e32\u4ee4\u4eba\u8d39\u89e3\u7684\u9519\u8bef\u4fe1\u606f\u3002\u5bf9\u4e8e\u4e2d\u9ad8\u7ea7\u5f00\u53d1\u8005\u6765\u8bf4&#xff0c;\u8fd9\u79cd\u4f53\u9a8c\u5c24\u5176\u4ee4\u4eba\u6cae\u4e27&#xff0c;\u56e0\u4e3a\u4f60\u6e05\u695a\u5730\u77e5\u9053\u5e95\u5c42\u6280\u672f\u6808\u7684\u6bcf\u4e00\u4e2a\u73af\u8282&#xff0c;\u5374\u4f9d\u7136\u53ef\u80fd\u88ab\u4e00\u4e9b\u9690\u853d\u7684\u914d\u7f6e\u51b2\u7a81\u3001\u7248\u672c\u4e0d\u5339\u914d\u6216\u73af\u5883\u5dee\u5f02\u7eca\u5012\u3002<\/p>\n<p>\u8fd9\u7bc7\u6587\u7ae0\u4e0d\u662f\u53e6\u4e00\u7bc7\u201c\u5982\u4f55\u542f\u52a8Puppeteer MCP\u201d\u7684\u57fa\u7840\u6559\u7a0b\u3002\u76f8\u53cd&#xff0c;\u6211\u4eec\u76f4\u63a5\u5207\u5165\u90a3\u4e9b\u771f\u6b63\u6d88\u8017\u5f00\u53d1\u8005\u65f6\u95f4\u7684\u8c03\u8bd5\u6df1\u6c34\u533a\u3002\u6211\u4eec\u5c06\u805a\u7126\u4e8e\u4e94\u4e2a\u6700\u5e38\u89c1\u7684\u201c\u5751\u201d&#xff0c;\u8fd9\u4e9b\u9677\u9631\u5f80\u5f80\u6e90\u4e8e\u5b89\u5168\u7b56\u7565\u7684\u5fae\u5999\u51b2\u7a81\u3001Chromium\u7248\u672c\u7684\u9690\u6027\u4e0d\u517c\u5bb9\u3001\u8d44\u6e90\u8def\u5f84\u7684\u914d\u7f6e\u9519\u8bef\u3001Docker\u4e0e\u672c\u5730\u73af\u5883\u7684\u5dee\u5f02&#xff0c;\u4ee5\u53ca\u5bf9\u5371\u9669\u53c2\u6570\u5904\u7406\u7684\u8bef\u89e3\u3002\u6bcf\u4e2a\u95ee\u9898\u80cc\u540e&#xff0c;\u6211\u4eec\u90fd\u5c06\u63d0\u4f9b\u57fa\u4e8e\u771f\u5b9e\u62a5\u9519\u65e5\u5fd7\u7684\u5206\u6790\u601d\u8def\u3001\u53ef\u64cd\u4f5c\u7684\u68c0\u67e5\u6e05\u5355&#xff0c;\u4ee5\u53ca\u7ecf\u8fc7\u9a8c\u8bc1\u7684\u89e3\u51b3\u65b9\u6848\u3002\u6211\u4eec\u7684\u76ee\u6807\u662f&#xff0c;\u5f53\u4f60\u4e0b\u6b21\u9047\u5230Puppeteer MCP\u670d\u52a1\u5668\u201c\u95f9\u813e\u6c14\u201d\u65f6&#xff0c;\u80fd\u50cf\u4e00\u4f4d\u7ecf\u9a8c\u4e30\u5bcc\u7684\u673a\u68b0\u5e08\u4e00\u6837&#xff0c;\u5feb\u901f\u5b9a\u4f4d\u95ee\u9898\u6839\u6e90&#xff0c;\u800c\u4e0d\u662f\u5728\u641c\u7d22\u5f15\u64ce\u548c\u793e\u533a\u8bba\u575b\u4e4b\u95f4\u75b2\u4e8e\u5954\u547d\u3002<\/p>\n<h3>1. \u5b89\u5168\u7b56\u7565\u51b2\u7a81\u4e0e\u5371\u9669\u53c2\u6570\u5904\u7406&#xff1a;\u5728\u4fbf\u5229\u4e0e\u98ce\u9669\u4e4b\u95f4\u8d70\u94a2\u4e1d<\/h3>\n<p>Puppeteer MCP\u670d\u52a1\u5668\u9ed8\u8ba4\u5185\u7f6e\u4e86\u4e00\u5957\u4e25\u683c\u7684\u5b89\u5168\u7b56\u7565&#xff0c;\u8fd9\u539f\u672c\u662f\u4e3a\u4e86\u9632\u6b62\u5728\u81ea\u52a8\u5316\u811a\u672c\u4e2d\u65e0\u610f\u95f4\u5f15\u5165\u5b89\u5168\u6f0f\u6d1e\u3002\u7136\u800c&#xff0c;\u8fd9\u5957\u7b56\u7565\u5728\u5b9e\u9645\u8c03\u8bd5\u4e2d&#xff0c;\u5c24\u5176\u662f\u5728\u7279\u5b9a\u7684\u672c\u5730\u6216\u5bb9\u5668\u5316\u73af\u5883\u4e2d&#xff0c;\u5e38\u5e38\u4f1a\u6210\u4e3a\u7b2c\u4e00\u9053\u969c\u788d\u3002\u6700\u5e38\u89c1\u7684\u51b2\u7a81\u70b9\u56f4\u7ed5\u7740&#8211;no-sandbox\u3001&#8211;disable-web-security\u8fd9\u7c7b\u88ab\u6807\u8bb0\u4e3a\u201c\u5371\u9669\u201d\u7684\u542f\u52a8\u53c2\u6570\u3002<\/p>\n<h4>1.1 \u7406\u89e3\u201cDangerous arguments detected\u201d\u9519\u8bef\u7684\u6839\u6e90<\/h4>\n<p>\u5f53\u4f60\u770b\u5230Dangerous arguments detected\u9519\u8bef\u65f6&#xff0c;\u670d\u52a1\u5668\u5b9e\u9645\u4e0a\u662f\u5728\u6267\u884c\u4e00\u4e2a\u5b89\u5168\u68c0\u67e5\u3002\u8fd9\u4e2a\u68c0\u67e5\u7531allowDangerous\u53c2\u6570\u63a7\u5236&#xff0c;\u9ed8\u8ba4\u503c\u4e3afalse\u3002\u5176\u903b\u8f91\u662f\u62e6\u622a\u90a3\u4e9b\u53ef\u80fd\u964d\u4f4e\u6d4f\u89c8\u5668\u5b89\u5168\u9694\u79bb\u7ea7\u522b\u7684\u53c2\u6570\u3002\u4f8b\u5982&#xff0c;\u5728Linux\u7684Docker\u5bb9\u5668\u5185\u6216\u65e0\u5934\u670d\u52a1\u5668\u73af\u5883\u4e2d&#xff0c;\u5982\u679c\u4e0d\u4f7f\u7528&#8211;no-sandbox&#xff0c;Chromium\u53ef\u80fd\u56e0\u6743\u9650\u95ee\u9898\u800c\u65e0\u6cd5\u542f\u52a8\u3002\u4f46\u5141\u8bb8\u8fd9\u4e9b\u53c2\u6570&#xff0c;\u53c8\u610f\u5473\u7740\u4f60\u7684\u6d4f\u89c8\u5668\u5b9e\u4f8b\u66f4\u5bb9\u6613\u53d7\u5230\u6076\u610f\u9875\u9762\u7684\u653b\u51fb\u3002<\/p>\n<p>\u5173\u952e\u5728\u4e8e\u7406\u89e3\u8fd9\u4e2a\u9519\u8bef\u7684\u89e6\u53d1\u6761\u4ef6\u3002\u5b83\u4e0d\u4ec5\u4ec5\u53d1\u751f\u5728\u4f60\u663e\u5f0f\u4f20\u9012args: [&#039;&#8211;no-sandbox&#039;]\u65f6\u3002\u6709\u65f6&#xff0c;\u901a\u8fc7\u73af\u5883\u53d8\u91cfPUPPETEER_LAUNCH_OPTIONS\u8bbe\u7f6e\u7684\u5168\u5c40\u914d\u7f6e&#xff0c;\u6216\u8005\u4ece\u5176\u4ed6\u914d\u7f6e\u6587\u4ef6\u7ee7\u627f\u7684\u9ed8\u8ba4\u503c&#xff0c;\u90fd\u53ef\u80fd\u6084\u6084\u5f15\u5165\u8fd9\u4e9b\u53c2\u6570\u3002<\/p>\n<p>\u6ce8\u610f&#xff1a;\u5728\u672c\u5730\u5f00\u53d1\u673a\u5668\u4e0a&#xff0c;\u9664\u975e\u4f60\u975e\u5e38\u6e05\u695a\u81ea\u5df1\u5728\u505a\u4ec0\u4e48&#xff0c;\u5e76\u4e14\u73af\u5883\u5b8c\u5168\u53ef\u63a7&#xff0c;\u5426\u5219\u5e94\u5c3d\u91cf\u907f\u514d\u542f\u7528allowDangerous\u3002\u5728\u670d\u52a1\u5668\u6216CI\/CD\u73af\u5883\u4e2d&#xff0c;\u5219\u9700\u8981\u6839\u636e\u5177\u4f53\u7684\u5b89\u5168\u7b56\u7565\u548c\u8fd0\u884c\u73af\u5883\u6765\u6743\u8861\u3002<\/p>\n<h4>1.2 \u5206\u573a\u666f\u5904\u7406\u7b56\u7565\u4e0e\u68c0\u67e5\u6e05\u5355<\/h4>\n<p>\u5904\u7406\u5b89\u5168\u7b56\u7565\u51b2\u7a81&#xff0c;\u4e0d\u80fd\u4e00\u6982\u800c\u8bba\u3002\u4f60\u9700\u8981\u6839\u636e\u4f60\u7684\u8fd0\u884c\u73af\u5883&#xff08;\u672c\u5730\u3001Docker\u3001CI&#xff09;\u548c\u5177\u4f53\u9700\u6c42\u6765\u51b3\u5b9a\u7b56\u7565\u3002<\/p>\n<p>\u573a\u666fA&#xff1a;\u672c\u5730\u5f00\u53d1\u8c03\u8bd5&#xff08;\u63a8\u8350\u4fdd\u6301\u5b89\u5168&#xff09;<br \/>\n\u5982\u679c\u4f60\u7684\u76ee\u6807\u53ea\u662f\u8c03\u8bd5\u7f51\u9875\u4ea4\u4e92&#xff0c;\u901a\u5e38\u4e0d\u9700\u8981\u5371\u9669\u53c2\u6570\u3002\u786e\u4fdd\u4f60\u7684\u914d\u7f6e\u4e2d\u79fb\u9664\u4e86\u6240\u6709\u5371\u9669\u53c2\u6570&#xff0c;\u5e76\u68c0\u67e5launchOptions\u3002<\/p>\n<p>\/\/ \u6b63\u786e\u7684\u672c\u5730\u8c03\u8bd5\u914d\u7f6e\u793a\u4f8b&#xff08;VS Code mcp.json&#xff09;<br \/>\n{<br \/>\n  &#034;mcpServers&#034;: {<br \/>\n    &#034;puppeteer&#034;: {<br \/>\n      &#034;command&#034;: &#034;npx&#034;,<br \/>\n      &#034;args&#034;: [&#034;-y&#034;, &#034;&#064;modelcontextprotocol\/server-puppeteer&#034;],<br \/>\n      &#034;env&#034;: {<br \/>\n        \/\/ \u660e\u786e\u6307\u5b9a\u5b89\u5168\u7684\u542f\u52a8\u53c2\u6570&#xff0c;\u8986\u76d6\u4efb\u4f55\u53ef\u80fd\u5305\u542b\u5371\u9669\u53c2\u6570\u7684\u9ed8\u8ba4\u8bbe\u7f6e<br \/>\n        &#034;PUPPETEER_LAUNCH_OPTIONS&#034;: &#034;{\\\\&#034;headless\\\\&#034;: false, \\\\&#034;args\\\\&#034;: []}&#034;<br \/>\n      }<br \/>\n    }<br \/>\n  }<br \/>\n}<\/p>\n<p>\u573a\u666fB&#xff1a;Docker\u6216Headless\u670d\u52a1\u5668\u73af\u5883<br \/>\n\u5728\u8fd9\u4e9b\u73af\u5883\u4e2d&#xff0c;\u6c99\u7bb1\u53ef\u80fd\u56e0\u5185\u6838\u914d\u7f6e\u6216\u6743\u9650\u95ee\u9898\u800c\u5931\u8d25\u3002\u6b64\u65f6&#xff0c;\u542f\u7528\u5371\u9669\u53c2\u6570\u662f\u5fc5\u8981\u7684&#xff0c;\u4f46\u5fc5\u987b\u4e25\u683c\u9650\u5236\u5176\u4f7f\u7528\u8303\u56f4\u3002<\/p>\n<li>\u6700\u5c0f\u5316\u539f\u5219&#xff1a;\u53ea\u6dfb\u52a0\u5fc5\u8981\u7684\u53c2\u6570\u3002\u901a\u5e38&#xff0c;&#8211;no-sandbox\u548c&#8211;disable-dev-shm-usage&#xff08;\u89e3\u51b3\/dev\/shm\u5185\u5b58\u4e0d\u8db3\u95ee\u9898&#xff09;\u662f\u5e38\u89c1\u7ec4\u5408\u3002<\/li>\n<li>\u73af\u5883\u9694\u79bb&#xff1a;\u786e\u4fdd\u8fd0\u884cPuppeteer\u7684\u5bb9\u5668\u6216\u670d\u52a1\u5668\u672c\u8eab\u662f\u9694\u79bb\u7684&#xff0c;\u4e0d\u8fd0\u884c\u5176\u4ed6\u5173\u952e\u670d\u52a1\u3002<\/li>\n<li>\u914d\u7f6e\u68c0\u67e5\u6e05\u5355&#xff1a;\n<ul>\n<li>\u786e\u8ba4allowDangerous: true\u5df2\u6b63\u786e\u8bbe\u7f6e\u3002<\/li>\n<li>\u68c0\u67e5PUPPETEER_LAUNCH_OPTIONS\u73af\u5883\u53d8\u91cf\u4e2d\u7684args\u6570\u7ec4\u3002<\/li>\n<li>\u9a8c\u8bc1\u5de5\u5177\u8c03\u7528&#xff08;\u5982puppeteer_navigate&#xff09;\u4e2d\u662f\u5426\u6ca1\u6709\u4f20\u9012\u4f1a\u8986\u76d6\u5168\u5c40\u5b89\u5168\u8bbe\u7f6e\u7684launchOptions\u3002<\/li>\n<\/ul>\n<\/li>\n<p># \u901a\u8fc7\u73af\u5883\u53d8\u91cf\u5728Docker\u4e2d\u5b89\u5168\u5730\u542f\u7528\u5fc5\u8981\u53c2\u6570<br \/>\ndocker run -e PUPPETEER_LAUNCH_OPTIONS&#061;&#039;{&#034;args&#034;: [&#034;&#8211;no-sandbox&#034;, &#034;&#8211;disable-dev-shm-usage&#034;]}&#039; -e ALLOW_DANGEROUS&#061;true your-puppeteer-image<\/p>\n<p>\u8c03\u8bd5\u6280\u5de7&#xff1a;\u5982\u4f55\u5b9a\u4f4d\u51b2\u7a81\u6765\u6e90<br \/>\n\u5f53\u9519\u8bef\u53d1\u751f\u65f6&#xff0c;\u4e0d\u8981\u53ea\u770b\u6700\u540e\u4e00\u884c\u3002\u542f\u7528Puppeteer\u7684\u8be6\u7ec6\u65e5\u5fd7&#xff0c;\u53ef\u4ee5\u8ba9\u4f60\u770b\u5230\u542f\u52a8\u53c2\u6570\u662f\u5728\u54ea\u4e2a\u9636\u6bb5\u88ab\u6ce8\u5165\u548c\u62d2\u7edd\u7684\u3002<\/p>\n<p># \u5728\u542f\u52a8\u547d\u4ee4\u524d\u8bbe\u7f6e\u8c03\u8bd5\u73af\u5883\u53d8\u91cf<br \/>\nenv DEBUG&#061;&#034;puppeteer:*&#034; npx &#064;modelcontextprotocol\/server-puppeteer<\/p>\n<p>\u67e5\u770b\u8f93\u51fa&#xff0c;\u5bfb\u627e\u7c7b\u4f3cLaunch options received:\u548cSecurity check failed for args:\u7684\u65e5\u5fd7\u884c\u3002\u8fd9\u80fd\u7cbe\u786e\u544a\u8bc9\u4f60&#xff0c;\u662f\u54ea\u4e2a\u914d\u7f6e\u6e90\u63d0\u4f9b\u4e86\u5371\u9669\u7684&#8211;no-sandbox\u53c2\u6570\u3002<\/p>\n<h3>2. Chromium\u7248\u672c\u517c\u5bb9\u6027&#xff1a;\u5f53Puppeteer\u4e0e\u7cfb\u7edf\u6d4f\u89c8\u5668\u201c\u95f9\u5206\u624b\u201d<\/h3>\n<p>\u8fd9\u662f\u6700\u9690\u853d\u3001\u4e5f\u6700\u4ee4\u4eba\u5934\u75bc\u7684\u95ee\u9898\u4e4b\u4e00\u3002Puppeteer\u9ed8\u8ba4\u4f1a\u4e0b\u8f7d\u5e76\u7ed1\u5b9a\u4e00\u4e2a\u7279\u5b9a\u7248\u672c\u7684Chromium\u3002\u800c\u4f60\u7cfb\u7edf\u4e0a\u5b89\u88c5\u7684Chrome\/Chromium&#xff0c;\u6216\u8005Docker\u955c\u50cf\u4e2d\u9884\u88c5\u7684\u6d4f\u89c8\u5668&#xff0c;\u53ef\u80fd\u662f\u53e6\u4e00\u4e2a\u7248\u672c\u3002\u5f53\u670d\u52a1\u5668\u5c1d\u8bd5\u8fde\u63a5\u73b0\u6709\u6d4f\u89c8\u5668\u5b9e\u4f8b&#xff08;\u901a\u8fc7puppeteer_connect_active_tab&#xff09;&#xff0c;\u6216\u8005\u4f60\u901a\u8fc7executablePath\u6307\u5b9a\u4e86\u7cfb\u7edf\u6d4f\u89c8\u5668\u8def\u5f84\u65f6&#xff0c;\u7248\u672c\u4e0d\u517c\u5bb9\u5c31\u4f1a\u5bfc\u81f4\u4e00\u7cfb\u5217\u8be1\u5f02\u6545\u969c\u3002<\/p>\n<h4>2.1 \u8bc6\u522b\u7248\u672c\u4e0d\u517c\u5bb9\u7684\u75c7\u72b6<\/h4>\n<p>\u75c7\u72b6\u5f80\u5f80\u4e0d\u662f\u76f4\u63a5\u7684\u201c\u7248\u672c\u9519\u8bef\u201d&#xff0c;\u800c\u662f\u8868\u73b0\u4e3a\u4e00\u4e9b\u770b\u4f3c\u968f\u673a\u7684\u95ee\u9898&#xff1a;<\/p>\n<ul>\n<li>puppeteer_connect_active_tab\u8fde\u63a5\u6210\u529f&#xff0c;\u4f46\u540e\u7eed\u7684\u4efb\u4f55\u64cd\u4f5c&#xff08;\u70b9\u51fb\u3001\u5bfc\u822a&#xff09;\u90fd\u5931\u8d25\u6216\u65e0\u54cd\u5e94\u3002<\/li>\n<li>\u6d4f\u89c8\u5668\u80fd\u542f\u52a8&#xff0c;\u4f46\u9875\u9762\u6e32\u67d3\u5f02\u5e38&#xff0c;CSS\u6216JavaScript\u884c\u4e3a\u4e0d\u7b26\u5408\u9884\u671f\u3002<\/li>\n<li>\u7279\u5b9a\u7684Puppeteer API\u8c03\u7528&#xff08;\u5982page.waitForNavigation\u7684\u67d0\u4e9b\u9009\u9879&#xff09;\u629b\u51fa\u6666\u6da9\u7684\u9519\u8bef\u3002<\/li>\n<li>\u5728Docker\u4e2d&#xff0c;\u4f7f\u7528puppeteer-core\u5e76\u6302\u8f7d\u4e3b\u673aChrome\u65f6&#xff0c;\u51fa\u73b0\u534f\u8bae\u901a\u4fe1\u9519\u8bef\u3002<\/li>\n<\/ul>\n<p>\u95ee\u9898\u7684\u6838\u5fc3\u5728\u4e8e&#xff0c;Puppeteer\u7684API\u4e0eChromium\u7684DevTools\u534f\u8bae\u7248\u672c\u5fc5\u987b\u5339\u914d\u3002\u6bcf\u4e2aPuppeteer\u7248\u672c\u90fd\u662f\u9488\u5bf9\u4e00\u4e2a\u7279\u5b9aChromium\u7248\u672c\u8fdb\u884c\u6d4b\u8bd5\u548c\u5c01\u88c5\u7684\u3002<\/p>\n<h4>2.2 \u89e3\u51b3\u65b9\u6848&#xff1a;\u7248\u672c\u9501\u5b9a\u4e0e\u8def\u5f84\u7ba1\u7406<\/h4>\n<p>\u7b56\u7565\u4e00&#xff1a;\u575a\u6301\u4f7f\u7528Puppeteer\u6346\u7ed1\u7684Chromium&#xff08;\u6700\u7701\u5fc3&#xff09;<br \/>\n\u5bf9\u4e8e\u5927\u591a\u6570\u81ea\u52a8\u5316\u4efb\u52a1&#xff0c;\u76f4\u63a5\u4f7f\u7528Puppeteer\u81ea\u5e26\u7684Chromium\u662f\u6700\u7a33\u5b9a\u7684\u9009\u62e9\u3002\u4e0d\u8981\u6307\u5b9aexecutablePath&#xff0c;\u8ba9Puppeteer\u7ba1\u7406\u4e00\u5207\u3002<\/p>\n<p>\/\/ \u5728\u81ea\u5b9a\u4e49\u542f\u52a8\u811a\u672c\u4e2d&#xff0c;\u4fdd\u6301launchOptions\u7b80\u6d01<br \/>\nconst browser &#061; await puppeteer.launch({<br \/>\n  headless: &#039;new&#039;, \/\/ \u4f7f\u7528\u65b0\u7684Headless\u6a21\u5f0f<br \/>\n  \/\/ \u4e0d\u63d0\u4f9b executablePath<br \/>\n});<\/p>\n<p>\u7b56\u7565\u4e8c&#xff1a;\u7cbe\u786e\u7ba1\u7406\u5916\u90e8\u6d4f\u89c8\u5668\u7248\u672c<br \/>\n\u5982\u679c\u4f60\u5fc5\u987b\u4f7f\u7528\u7cfb\u7edfChrome&#xff08;\u4f8b\u5982&#xff0c;\u9700\u8981\u7279\u5b9a\u63d2\u4ef6\u6216\u5a92\u4f53\u7f16\u7801\u652f\u6301&#xff09;&#xff0c;\u5c31\u5fc5\u987b\u8fdb\u884c\u7248\u672c\u5bf9\u9f50\u3002<\/p>\n<li>\n<p>\u67e5\u8be2\u7248\u672c&#xff1a;<\/p>\n<p># \u67e5\u8be2Puppeteer\u5305\u5185\u7f6e\u7684Chromium\u7248\u672c<br \/>\nnpm list puppeteer | grep puppeteer<br \/>\n# \u7136\u540e\u67e5\u770bnode_modules\/puppeteer\/package.json\u4e2d\u7684&#096;chromium_revision&#096;\u5b57\u6bb5<\/p>\n<p># \u67e5\u8be2\u7cfb\u7edfChrome\u7248\u672c<br \/>\ngoogle-chrome &#8211;version # Linux<br \/>\n\/Applications\/Google\\\\ Chrome.app\/Contents\/MacOS\/Google\\\\ Chrome &#8211;version # Mac<\/p>\n<\/li>\n<li>\n<p>\u7248\u672c\u5339\u914d\u8868&#xff1a;\u4f60\u9700\u8981\u624b\u52a8\u7ef4\u62a4\u4e00\u4e2a\u7b80\u5355\u7684\u7248\u672c\u5bf9\u5e94\u5173\u7cfb\u3002\u4f8b\u5982&#xff1a;<\/p>\n<table>\n<tr>Puppeteer \u7248\u672c\u6346\u7ed1\u7684 Chromium \u7248\u672c<\/tr>\n<tbody>\n<tr>\n<td style=\"text-align:left\">21.0.0<\/td>\n<td style=\"text-align:left\">~119.0.6045.105<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left\">20.0.0<\/td>\n<td style=\"text-align:left\">~118.0.5993.88<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left\">19.0.0<\/td>\n<td style=\"text-align:left\">~117.0.5938.92<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u6839\u636e\u4f60\u5b89\u88c5\u7684Puppeteer\u7248\u672c&#xff0c;\u53bb\u5347\u7ea7\u6216\u964d\u7ea7\u4f60\u7684\u7cfb\u7edfChrome&#xff0c;\u4f7f\u5176\u4e3b\u7248\u672c\u53f7\u5c3d\u91cf\u63a5\u8fd1\u3002<\/p>\n<\/li>\n<p>\u7b56\u7565\u4e09&#xff1a;Docker\u73af\u5883\u4e0b\u7684\u6700\u4f73\u5b9e\u8df5<br \/>\n\u5728Docker\u4e2d&#xff0c;\u5f3a\u70c8\u5efa\u8bae\u4f7f\u7528\u5b98\u65b9Puppeteer\u955c\u50cf\u6216\u57fa\u4e8e\u5176\u6784\u5efa\u7684\u955c\u50cf&#xff0c;\u5b83\u4eec\u5df2\u7ecf\u505a\u597d\u4e86\u7248\u672c\u5bf9\u9f50\u3002<\/p>\n<p>FROM ghcr.io\/puppeteer\/puppeteer:21.0.0<br \/>\n# \u8fd9\u4e2a\u955c\u50cf\u5df2\u7ecf\u5305\u542b\u4e86\u5339\u914d\u7684Node.js, Puppeteer\u548cChromium<\/p>\n<p>\u5982\u679c\u4f60\u5fc5\u987b\u5728\u81ea\u5b9a\u4e49Docker\u955c\u50cf\u4e2d\u4f7f\u7528\u7cfb\u7edf\u5305\u7ba1\u7406\u5668\u5b89\u88c5Chromium&#xff0c;\u52a1\u5fc5\u5728Dockerfile\u4e2d\u56fa\u5b9a\u7248\u672c\u53f7&#xff0c;\u5e76\u4e0e\u9879\u76eepackage.json\u4e2d\u7684Puppeteer\u7248\u672c\u6838\u5bf9\u3002<\/p>\n<h4>2.3 \u8c03\u8bd5\u5de5\u5177&#xff1a;\u4e3b\u52a8\u68c0\u6d4b\u517c\u5bb9\u6027<\/h4>\n<p>\u7f16\u5199\u4e00\u4e2a\u7b80\u5355\u7684\u517c\u5bb9\u6027\u68c0\u67e5\u811a\u672c&#xff0c;\u53ef\u4ee5\u5728\u670d\u52a1\u5668\u542f\u52a8\u65f6\u6216\u8fde\u63a5\u5916\u90e8\u6d4f\u89c8\u5668\u524d\u8fd0\u884c&#xff1a;<\/p>\n<p>\/\/ check-compatibility.js<br \/>\nconst puppeteer &#061; require(&#039;puppeteer&#039;);<br \/>\nconst chromeVersion &#061; require(&#039;chrome-version&#039;); \/\/ \u9700\u8981\u5b89\u88c5\u6b64\u5305<\/p>\n<p>(async () &#061;&gt; {<br \/>\n  const puppeteerInfo &#061; require(&#039;.\/node_modules\/puppeteer\/package.json&#039;);<br \/>\n  console.log(&#096;Puppeteer\u7248\u672c: ${puppeteerInfo.version}&#096;);<br \/>\n  console.log(&#096;\u6346\u7ed1\u7684Chromium\u7248\u672c: ${puppeteerInfo.chromium_revision}&#096;);<\/p>\n<p>  try {<br \/>\n    const version &#061; await chromeVersion();<br \/>\n    console.log(&#096;\u7cfb\u7edfChrome\u7248\u672c: ${version}&#096;);<br \/>\n    \/\/ \u8fd9\u91cc\u53ef\u4ee5\u6dfb\u52a0\u7b80\u5355\u7684\u903b\u8f91&#xff0c;\u6bd4\u8f83\u4e3b\u7248\u672c\u53f7\u662f\u5426\u5339\u914d<br \/>\n  } catch (e) {<br \/>\n    console.log(&#039;\u65e0\u6cd5\u83b7\u53d6\u7cfb\u7edfChrome\u7248\u672c:&#039;, e.message);<br \/>\n  }<br \/>\n})();<\/p>\n<h3>3. \u8d44\u6e90\u8def\u5f84\u4e0e\u6743\u9650\u9519\u8bef&#xff1a;\u622a\u56fe\u4e0d\u4fdd\u5b58\u3001\u65e5\u5fd7\u65e0\u5904\u5bfb<\/h3>\n<p>Puppeteer MCP\u670d\u52a1\u5668\u8fd0\u884c\u8fc7\u7a0b\u4e2d\u4f1a\u4ea7\u751f\u4e24\u7c7b\u4e3b\u8981\u201c\u8d44\u6e90\u201d&#xff1a;\u622a\u56fe\u548c\u63a7\u5236\u53f0\u65e5\u5fd7\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b&#xff0c;\u8fd9\u4e9b\u8d44\u6e90\u53ef\u80fd\u88ab\u5b58\u50a8\u5728\u5185\u5b58\u4e2d&#xff0c;\u6216\u5199\u5165\u4e34\u65f6\u76ee\u5f55\u3002\u4f46\u5728\u67d0\u4e9b\u914d\u7f6e\u4e0b&#xff0c;\u4f60\u53ef\u80fd\u4f1a\u9047\u5230puppeteer_screenshot\u5de5\u5177\u8c03\u7528\u6210\u529f\u5374\u627e\u4e0d\u5230\u56fe\u7247&#xff0c;\u6216\u8005console:\/\/logs\u8d44\u6e90\u8fd4\u56de\u7a7a\u5185\u5bb9\u7684\u95ee\u9898\u3002\u8fd9\u901a\u5e38\u4e0e\u6587\u4ef6\u7cfb\u7edf\u8def\u5f84\u3001\u5199\u5165\u6743\u9650\u6216\u8d44\u6e90\u6e05\u7406\u7b56\u7565\u6709\u5173\u3002<\/p>\n<h4>3.1 \u622a\u56fe\u8d44\u6e90\u4e22\u5931\u7684\u6392\u67e5\u6d41\u7a0b<\/h4>\n<p>\u5f53\u4f60\u901a\u8fc7MCP\u5ba2\u6237\u7aef&#xff08;\u5982Claude Desktop\u7684\u68c0\u67e5\u5668&#xff09;\u8c03\u7528\u622a\u56fe\u5de5\u5177\u5e76\u6536\u5230\u6210\u529f\u54cd\u5e94&#xff0c;\u5374\u65e0\u6cd5\u5728\u9884\u671f\u4f4d\u7f6e\u627e\u5230\u56fe\u7247&#xff0c;\u6216\u68c0\u67e5\u5668\u65e0\u6cd5\u9884\u89c8\u65f6&#xff0c;\u8bf7\u6309\u4ee5\u4e0b\u6b65\u9aa4\u6392\u67e5&#xff1a;<\/p>\n<li>\u786e\u8ba4\u8d44\u6e90URI&#xff1a;\u9996\u5148&#xff0c;\u5de5\u5177\u8fd4\u56de\u7684\u6210\u529f\u54cd\u5e94\u4e2d\u901a\u5e38\u4f1a\u5305\u542b\u8d44\u6e90\u7684\u8bbf\u95eeURI&#xff0c;\u4f8b\u5982screenshot:\/\/my_screenshot_20240527\u3002\u8bb0\u4e0b\u8fd9\u4e2a\u5b8c\u6574\u7684URI\u3002<\/li>\n<li>\u68c0\u67e5MCP\u5ba2\u6237\u7aef\u7684\u8d44\u6e90\u8bfb\u53d6\u80fd\u529b&#xff1a;\u5e76\u975e\u6240\u6709MCP\u5ba2\u6237\u7aef\u90fd\u5b9e\u73b0\u4e86\u5b8c\u6574\u7684\u8d44\u6e90\u8bfb\u53d6\u548c\u6e32\u67d3\u529f\u80fd\u3002\u5c1d\u8bd5\u901a\u8fc7MCP\u670d\u52a1\u5668\u7684\u539f\u751fHTTP\u7aef\u70b9&#xff08;\u5982\u679c\u66b4\u9732&#xff09;\u6216\u76f4\u63a5\u4f7f\u7528curl\u547d\u4ee4\u6765\u83b7\u53d6\u8d44\u6e90\u3002# \u5047\u8bbe\u670d\u52a1\u5668\u8fd0\u884c\u5728localhost:3000&#xff0c;\u5e76\u4e14\u652f\u6301\u8d44\u6e90\u7aef\u70b9<br \/>\ncurl -o screenshot.png http:\/\/localhost:3000\/resources\/screenshot:\/\/my_screenshot_20240527<\/p>\n<p>\u5982\u679ccurl\u6210\u529f\u4f46\u5ba2\u6237\u7aef\u4e0d\u663e\u793a&#xff0c;\u95ee\u9898\u53ef\u80fd\u51fa\u5728\u5ba2\u6237\u7aef\u3002<\/li>\n<li>\u68c0\u67e5\u670d\u52a1\u5668\u5de5\u4f5c\u76ee\u5f55\u4e0e\u6743\u9650&#xff1a;\u670d\u52a1\u5668\u8fdb\u7a0b\u9700\u8981\u6709\u5bf9\u5f53\u524d\u5de5\u4f5c\u76ee\u5f55\u6216\u5176\u914d\u7f6e\u7684\u622a\u56fe\u76ee\u5f55\u7684\u5199\u5165\u6743\u9650\u3002\u7279\u522b\u662f\u5728Docker\u4e2d&#xff0c;\u5982\u679c\u4ee5\u975eroot\u7528\u6237\u8fd0\u884c&#xff0c;\u9700\u8981\u786e\u4fdd\u6302\u8f7d\u7684\u5377\u6709\u6b63\u786e\u6743\u9650\u3002# Dockerfile\u793a\u4f8b&#xff1a;\u521b\u5efa\u5177\u6709\u5199\u5165\u6743\u9650\u7684\u76ee\u5f55\u5e76\u8bbe\u7f6e\u7528\u6237<br \/>\nRUN mkdir -p \/home\/pptruser\/screenshots &amp;&amp; chown -R pptruser:pptruser \/home\/pptruser<br \/>\nUSER pptruser<br \/>\nWORKDIR \/home\/pptruser<\/p>\n<\/li>\n<li>\u5ba1\u67e5\u670d\u52a1\u5668\u65e5\u5fd7&#xff1a;\u542f\u52a8\u670d\u52a1\u5668\u65f6&#xff0c;\u5173\u6ce8\u662f\u5426\u6709\u5173\u4e8e\u6587\u4ef6\u5199\u5165\u5931\u8d25\u7684\u8b66\u544a\u6216\u9519\u8bef\u65e5\u5fd7\u3002\u6709\u4e9bPuppeteer MCP\u5b9e\u73b0\u5141\u8bb8\u901a\u8fc7\u73af\u5883\u53d8\u91cf\u914d\u7f6e\u622a\u56fe\u5b58\u50a8\u8def\u5f84\u3002<\/li>\n<h4>3.2 \u63a7\u5236\u53f0\u65e5\u5fd7\u6536\u96c6\u5931\u8d25\u5206\u6790<\/h4>\n<p>\u63a7\u5236\u53f0\u65e5\u5fd7\u8d44\u6e90console:\/\/logs\u901a\u5e38\u662f\u5b9e\u65f6\u6d41\u6216\u7f13\u51b2\u533a\u3002\u5982\u679c\u5b83\u603b\u662f\u7a7a\u7684&#xff0c;\u53ef\u80fd\u539f\u56e0\u6709&#xff1a;<\/p>\n<ul>\n<li>\u6d4f\u89c8\u5668\u542f\u52a8\u914d\u7f6e\u95ee\u9898&#xff1a;\u5982\u679c\u6d4f\u89c8\u5668\u4ee5\u5b8c\u5168\u65e0\u5934\u4e14\u65e0\u65e5\u5fd7\u91cd\u5b9a\u5411\u7684\u6a21\u5f0f\u542f\u52a8&#xff0c;\u63a7\u5236\u53f0\u8f93\u51fa\u53ef\u80fd\u88ab\u4e22\u5f03\u3002<\/li>\n<li>\u9875\u9762\u4e0a\u4e0b\u6587\u95ee\u9898&#xff1a;page.on(&#039;console&#039;)\u4e8b\u4ef6\u76d1\u542c\u5668\u53ef\u80fd\u6ca1\u6709\u6b63\u786e\u9644\u52a0\u5230\u76ee\u6807\u9875\u9762\u3002<\/li>\n<li>\u8d44\u6e90\u6e05\u7406\u8fc7\u65e9&#xff1a;\u65e5\u5fd7\u8d44\u6e90\u53ef\u80fd\u5728\u6bcf\u6b21\u5bfc\u822a\u540e\u88ab\u6e05\u7a7a&#xff0c;\u800c\u4f60\u7684\u67e5\u8be2\u65f6\u673a\u4e0d\u5bf9\u3002<\/li>\n<\/ul>\n<p>\u8c03\u8bd5\u5efa\u8bae&#xff1a;\u5728\u8c03\u7528puppeteer_navigate\u65f6&#xff0c;\u5c1d\u8bd5\u5728launchOptions\u6216page.goto\u7684\u9009\u9879\u4e2d\u542f\u7528\u66f4\u8be6\u7ec6\u7684\u65e5\u5fd7&#xff0c;\u5e76\u786e\u4fdd\u5728\u64cd\u4f5c\u540e\u7a0d\u7b49\u7247\u523b\u518d\u8bf7\u6c42\u65e5\u5fd7\u8d44\u6e90\u3002<\/p>\n<p>{<br \/>\n  &#034;url&#034;: &#034;https:\/\/example.com&#034;,<br \/>\n  &#034;launchOptions&#034;: {<br \/>\n    &#034;headless&#034;: false,<br \/>\n    \/\/ \u4f20\u9012\u989d\u5916\u7684Chromium\u6807\u5fd7\u4ee5\u542f\u7528\u8be6\u7ec6\u65e5\u5fd7&#xff08;\u5982\u679c\u9700\u8981&#xff09;<br \/>\n    &#034;args&#034;: [&#034;&#8211;enable-logging&#034;, &#034;&#8211;v&#061;1&#034;]<br \/>\n  }<br \/>\n}<\/p>\n<h4>3.3 \u914d\u7f6e\u81ea\u5b9a\u4e49\u8d44\u6e90\u8def\u5f84<\/h4>\n<p>\u4e00\u4e9b\u9ad8\u7ea7\u7684Puppeteer MCP\u670d\u52a1\u5668\u5b9e\u73b0&#xff08;\u6216\u4f60\u81ea\u5df1fork\u7684\u7248\u672c&#xff09;\u652f\u6301\u901a\u8fc7\u73af\u5883\u53d8\u91cf\u81ea\u5b9a\u4e49\u8d44\u6e90\u5b58\u50a8\u3002\u67e5\u9605\u4f60\u6240\u4f7f\u7528\u670d\u52a1\u5668\u7684\u6587\u6863\u6216\u6e90\u7801&#xff0c;\u5bfb\u627e\u7c7b\u4f3c\u4ee5\u4e0b\u7684\u914d\u7f6e&#xff1a;<\/p>\n<p># \u5047\u8bbe\u7684\u73af\u5883\u53d8\u91cf\u793a\u4f8b<br \/>\nexport SCREENSHOT_DIR&#061;\/var\/data\/puppeteer\/screenshots<br \/>\nexport LOG_BUFFER_SIZE&#061;5000 # \u63a7\u5236\u53f0\u65e5\u5fd7\u7f13\u51b2\u533a\u884c\u6570<\/p>\n<p>\u5728Docker Compose\u6216Kubernetes\u90e8\u7f72\u4e2d&#xff0c;\u4f60\u9700\u8981\u5c06\u8fd9\u4e9b\u8def\u5f84\u6302\u8f7d\u5230\u6301\u4e45\u5316\u5b58\u50a8\u5377&#xff0c;\u5e76\u786e\u4fdd\u5bb9\u5668\u5185\u8fdb\u7a0b\u6709\u8bfb\u5199\u6743\u9650\u3002<\/p>\n<h3>4. Docker\u4e0e\u672c\u5730\u73af\u5883\u5dee\u5f02&#xff1a;\u4ece\u201c\u6211\u673a\u5668\u4e0a\u597d\u597d\u7684\u201d\u5230\u751f\u4ea7\u5d29\u6e83<\/h3>\n<p>\u201c\u5b83\u5728\u6211\u7684\u673a\u5668\u4e0a\u80fd\u8fd0\u884c\u3002\u201d\u2014\u2014\u8fd9\u53e5\u5f00\u53d1\u8005\u7684\u7ecf\u5178\u540d\u8a00\u5728Puppeteer MCP\u7684Docker\u5316\u90e8\u7f72\u4e2d\u5c24\u4e3a\u7a81\u51fa\u3002\u672c\u5730Mac\/Windows\u4e0a\u8fd0\u884c\u987a\u7545\u7684\u914d\u7f6e&#xff0c;\u4e00\u65e6\u653e\u8fdbLinux Docker\u5bb9\u5668&#xff0c;\u5c31\u53ef\u80fd\u56e0\u4e3a\u4f9d\u8d56\u7f3a\u5931\u3001\u5b57\u4f53\u3001\u6c99\u7bb1\u3001\u5171\u4eab\u5185\u5b58\u7b49\u95ee\u9898\u800c\u5d29\u6e83\u3002<\/p>\n<h4>4.1 \u5173\u952e\u5dee\u5f02\u70b9\u4e0e\u95ee\u9898\u5bf9\u7167\u8868<\/h4>\n<p>\u7406\u89e3\u8fd9\u4e9b\u5dee\u5f02\u662f\u89e3\u51b3\u95ee\u9898\u7684\u7b2c\u4e00\u6b65\u3002\u4e0b\u8868\u5217\u51fa\u4e86\u6700\u5e38\u89c1\u7684\u95ee\u9898\u70b9&#xff1a;<\/p>\n<table>\n<tr>\u95ee\u9898\u9886\u57df\u672c\u5730\u73af\u5883&#xff08;Mac\/Windows&#xff09;Docker\u5bb9\u5668&#xff08;Linux&#xff09;\u5bfc\u81f4\u7684\u5178\u578b\u75c7\u72b6<\/tr>\n<tbody>\n<tr>\n<td style=\"text-align:left\">\u7cfb\u7edf\u4f9d\u8d56<\/td>\n<td style=\"text-align:left\">\u901a\u5e38\u5df2\u5b89\u88c5\u6216\u7531Puppeteer\u81ea\u52a8\u5904\u7406<\/td>\n<td style=\"text-align:left\">\u57fa\u7840\u955c\u50cf&#xff08;\u5982node:slim&#xff09;\u6781\u5ea6\u7cbe\u7b80&#xff0c;\u7f3a\u5c11\u8fd0\u884cChromium\u7684\u5e93<\/td>\n<td style=\"text-align:left\">Failed to launch the browser process!&#xff0c;\u63d0\u53ca\u7f3a\u5c11.so\u5e93\u6587\u4ef6<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left\">\u5b57\u4f53\u6e32\u67d3<\/td>\n<td style=\"text-align:left\">\u7cfb\u7edf\u5b57\u4f53\u4e30\u5bcc<\/td>\n<td style=\"text-align:left\">\u53ea\u6709\u6781\u5c11\u6570\u57fa\u672c\u5b57\u4f53&#xff0c;\u4e2d\u6587\u5b57\u4f53\u7f3a\u5931<\/td>\n<td style=\"text-align:left\">\u622a\u56fe\u4e2d\u7684\u6587\u5b57\u663e\u793a\u4e3a\u65b9\u6846&#xff08;\u25a1\u25a1\u25a1&#xff09;&#xff0c;\u6216\u5e03\u5c40\u9519\u4e71<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left\">\u6c99\u7bb1\u5b89\u5168<\/td>\n<td style=\"text-align:left\">\u7528\u6237\u6743\u9650\u5bbd\u677e&#xff0c;\u6c99\u7bb1\u901a\u5e38\u53ef\u8fd0\u884c<\/td>\n<td style=\"text-align:left\">\u5bb9\u5668\u5185\u7528\u6237\u547d\u540d\u7a7a\u95f4\u9650\u5236&#xff0c;\u9ed8\u8ba4\u6c99\u7bb1\u5e38\u5931\u8d25<\/td>\n<td style=\"text-align:left\">\u9700\u8981&#8211;no-sandbox\u53c2\u6570&#xff0c;\u5426\u5219\u6d4f\u89c8\u5668\u65e0\u6cd5\u542f\u52a8<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left\">\u5171\u4eab\u5185\u5b58<\/td>\n<td style=\"text-align:left\">\/dev\/shm\u5927\u5c0f\u901a\u5e38\u8db3\u591f<\/td>\n<td style=\"text-align:left\">\u9ed8\u8ba464MB&#xff0c;\u53ef\u80fd\u5bfc\u81f4\u5185\u5b58\u4e0d\u8db3\u5d29\u6e83<\/td>\n<td style=\"text-align:left\">\u6807\u7b7e\u9875\u5d29\u6e83&#xff0c;\u6216\u51fa\u73b0Page crashed!\u9519\u8bef<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left\">\u7528\u6237\u6570\u636e\u76ee\u5f55<\/td>\n<td style=\"text-align:left\">\u6709\u7a33\u5b9a\u7684\u7528\u6237\u4e3b\u76ee\u5f55<\/td>\n<td style=\"text-align:left\">\u4e34\u65f6\u6587\u4ef6\u7cfb\u7edf&#xff0c;\u6570\u636e\u53ef\u80fd\u4e22\u5931<\/td>\n<td style=\"text-align:left\">\u6d4f\u89c8\u5668\u4f1a\u8bdd\u3001Cookie\u65e0\u6cd5\u6301\u4e45\u5316<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>4.2 \u6784\u5efa\u5065\u58ee\u7684Docker\u955c\u50cf&#xff1a;\u4e00\u4efd\u5b9e\u6218\u6e05\u5355<\/h4>\n<p>\u4e0d\u8981\u4ecenode:latest\u5f00\u59cb\u3002\u4f7f\u7528\u4e3aPuppeteer\u4f18\u5316\u8fc7\u7684\u5b98\u65b9\u57fa\u7840\u955c\u50cf&#xff0c;\u6216\u8005\u57fa\u4e8e\u5b83\u4eec\u6784\u5efa\u3002<\/p>\n<p># \u4f7f\u7528Puppeteer\u5b98\u65b9\u955c\u50cf\u4f5c\u4e3a\u57fa\u7840&#xff08;\u63a8\u8350&#xff09;<br \/>\nFROM ghcr.io\/puppeteer\/puppeteer:21.0.0<\/p>\n<p># \u6216\u8005&#xff0c;\u5982\u679c\u4f60\u9700\u8981\u4eceNode.js\u955c\u50cf\u5f00\u59cb&#xff0c;\u5fc5\u987b\u5b89\u88c5\u6240\u6709\u4f9d\u8d56<br \/>\nFROM node:18-bullseye-slim # \u4f7f\u7528\u8f83\u5b8c\u6574\u7684\u53d1\u884c\u7248<\/p>\n<p># \u5b89\u88c5Chromium\u8fd0\u884c\u6240\u9700\u7684\u7cfb\u7edf\u5e93\u548c\u5b57\u4f53<br \/>\nRUN apt-get update \\\\<br \/>\n    &amp;&amp; apt-get install -y wget gnupg \\\\<br \/>\n    &amp;&amp; wget -q -O &#8211; https:\/\/dl-ssl.google.com\/linux\/linux_signing_key.pub | apt-key add &#8211; \\\\<br \/>\n    &amp;&amp; sh -c &#039;echo &#034;deb [arch&#061;amd64] http:\/\/dl.google.com\/linux\/chrome\/deb\/ stable main&#034; &gt;&gt; \/etc\/apt\/sources.list.d\/google.list&#039; \\\\<br \/>\n    &amp;&amp; apt-get update \\\\<br \/>\n    &amp;&amp; apt-get install -y google-chrome-stable fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf libxss1 \\\\<br \/>\n      &#8211;no-install-recommends \\\\<br \/>\n    &amp;&amp; rm -rf \/var\/lib\/apt\/lists\/*<\/p>\n<p># \u6e05\u7406\u7f13\u5b58&#xff0c;\u51cf\u5c11\u955c\u50cf\u5c42\u5927\u5c0f<br \/>\nRUN apt-get purge &#8211;auto-remove -y curl \\\\<br \/>\n    &amp;&amp; rm -rf \/src\/*.deb<\/p>\n<p># \u521b\u5efa\u5e76\u5207\u6362\u5230\u975eroot\u7528\u6237<br \/>\nRUN groupadd -r pptruser &amp;&amp; useradd -r -g pptruser -G audio,video pptruser \\\\<br \/>\n    &amp;&amp; mkdir -p \/home\/pptruser\/Downloads \\\\<br \/>\n    &amp;&amp; chown -R pptruser:pptruser \/home\/pptruser<\/p>\n<p>WORKDIR \/app<br \/>\nCOPY package*.json .\/<br \/>\nRUN npm ci &#8211;only&#061;production<br \/>\nCOPY . .<br \/>\nUSER pptruser<\/p>\n<p># \u8bbe\u7f6e\u73af\u5883\u53d8\u91cf&#xff0c;\u89e3\u51b3Docker\u5185\u5e38\u89c1\u95ee\u9898<br \/>\nENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD&#061;true \\\\<br \/>\n    PUPPETEER_EXECUTABLE_PATH&#061;\/usr\/bin\/google-chrome-stable \\\\<br \/>\n    NODE_ENV&#061;production<\/p>\n<p># \u542f\u52a8\u547d\u4ee4\u4e2d\u5fc5\u987b\u5305\u542b\u5fc5\u8981\u7684\u53c2\u6570<br \/>\nCMD [&#034;node&#034;, &#034;server.js&#034;]<\/p>\n<p>\u5173\u952e\u73af\u5883\u53d8\u91cf\u89e3\u91ca&#xff1a;<\/p>\n<ul>\n<li>PUPPETEER_SKIP_CHROMIUM_DOWNLOAD&#061;true&#xff1a;\u56e0\u4e3a\u6211\u4eec\u5b89\u88c5\u4e86\u7cfb\u7edfChrome&#xff0c;\u8df3\u8fc7\u4e0b\u8f7d\u6346\u7ed1\u7684Chromium\u3002<\/li>\n<li>PUPPETEER_EXECUTABLE_PATH&#xff1a;\u660e\u786e\u6307\u5411\u6211\u4eec\u5b89\u88c5\u7684Chrome\u8def\u5f84\u3002<\/li>\n<li>\u5728CMD\u4e2d\u542f\u52a8\u6d4f\u89c8\u5668\u65f6&#xff0c;\u52a1\u5fc5\u5305\u542b&#8211;no-sandbox\u548c&#8211;disable-dev-shm-usage\u3002<\/li>\n<\/ul>\n<h4>4.3 \u8c03\u8bd5Docker\u5185\u95ee\u9898\u7684\u4e13\u7528\u547d\u4ee4<\/h4>\n<p>\u5f53\u5bb9\u5668\u5185\u7684Puppeteer MCP\u670d\u52a1\u5668\u884c\u4e3a\u5f02\u5e38\u65f6&#xff0c;\u53ef\u4ee5\u8fdb\u5165\u5bb9\u5668\u5185\u90e8\u8fdb\u884c\u8bca\u65ad&#xff1a;<\/p>\n<p># 1. \u4ee5\u4ea4\u4e92\u6a21\u5f0f\u8fdb\u5165\u6b63\u5728\u8fd0\u884c\u7684\u5bb9\u5668<br \/>\ndocker exec -it &lt;container_name&gt; \/bin\/bash<\/p>\n<p># 2. \u68c0\u67e5Chrome\u662f\u5426\u80fd\u542f\u52a8<br \/>\ngoogle-chrome-stable &#8211;no-sandbox &#8211;disable-dev-shm-usage &#8211;headless &#8211;disable-gpu &#8211;dump-dom https:\/\/example.com<\/p>\n<p># 3. \u68c0\u67e5\u4f9d\u8d56\u5e93\u662f\u5426\u5b8c\u6574<br \/>\nldd $(which google-chrome-stable) | grep &#034;not found&#034;<\/p>\n<p># 4. \u68c0\u67e5\u5b57\u4f53<br \/>\nfc-list :lang&#061;zh<\/p>\n<p># 5. \u67e5\u770b\u5bb9\u5668\u5185\u7684\u8fdb\u7a0b\u548c\u8d44\u6e90\u9650\u5236<br \/>\ncat \/proc\/$(pgrep node)\/limits | grep -i &#034;memlock\\\\|address&#034;<\/p>\n<h3>5. \u7f51\u7edc\u7b56\u7565\u3001\u4ee3\u7406\u4e0e\u8d85\u65f6&#xff1a;\u6c89\u9ed8\u7684\u5931\u8d25\u6700\u96be\u8bca\u65ad<\/h3>\n<p>\u6700\u540e\u8fd9\u4e2a\u201c\u5751\u201d\u6d89\u53ca\u7f51\u7edc\u5c42\u3002Puppeteer MCP\u670d\u52a1\u5668\u53ef\u80fd\u9700\u8981\u8bbf\u95ee\u5916\u90e8\u7f51\u9875&#xff0c;\u800c\u4f60\u7684\u516c\u53f8\u7f51\u7edc\u3001Docker\u7f51\u7edc\u914d\u7f6e\u6216\u672c\u5730\u4ee3\u7406\u8bbe\u7f6e\u53ef\u80fd\u4f1a\u9ed8\u9ed8\u5730\u62e6\u622a\u6216\u4fee\u6539\u8fd9\u4e9b\u8bf7\u6c42&#xff0c;\u5bfc\u81f4\u5bfc\u822a\u8d85\u65f6\u3001\u9875\u9762\u52a0\u8f7d\u4e0d\u5168\u6216SSL\u8bc1\u4e66\u9519\u8bef\u3002\u8fd9\u4e9b\u95ee\u9898\u5f80\u5f80\u6ca1\u6709\u6e05\u6670\u7684\u9519\u8bef\u4fe1\u606f&#xff0c;\u53ea\u662f\u8868\u73b0\u4e3a\u201c\u9875\u9762\u4e00\u76f4\u52a0\u8f7d\u4e2d\u201d\u6216\u201c\u5143\u7d20\u627e\u4e0d\u5230\u201d\u3002<\/p>\n<h4>5.1 \u5bfc\u822a\u8d85\u65f6\u4e0e\u9875\u9762\u52a0\u8f7d\u5931\u8d25\u7684\u6392\u67e5<\/h4>\n<p>\u9ed8\u8ba4\u60c5\u51b5\u4e0b&#xff0c;page.goto()\u6709\u4e00\u4e2a30\u79d2\u7684\u8d85\u65f6\u3002\u5982\u679c\u76ee\u6807\u7f51\u7ad9\u6162&#xff0c;\u6216\u8005\u7f51\u7edc\u6709\u5ef6\u8fdf&#xff0c;\u5c31\u53ef\u80fd\u8d85\u65f6\u3002<\/p>\n<p>\u89e3\u51b3\u65b9\u6848A&#xff1a;\u8c03\u6574\u5bfc\u822a\u9009\u9879<br \/>\n\u5728puppeteer_navigate\u5de5\u5177\u8c03\u7528\u4e2d&#xff0c;\u5145\u5206\u5229\u7528Puppeteer\u7684\u5bfc\u822a\u9009\u9879\u3002<\/p>\n<p>{<br \/>\n  &#034;url&#034;: &#034;https:\/\/a-slow-website.com&#034;,<br \/>\n  &#034;launchOptions&#034;: {<br \/>\n    \/\/ \u6d4f\u89c8\u5668\u542f\u52a8\u9009\u9879<br \/>\n  },<br \/>\n  \/\/ \u6ce8\u610f&#xff1a;\u90e8\u5206Puppeteer MCP\u670d\u52a1\u5668\u5b9e\u73b0\u53ef\u80fd\u5141\u8bb8\u5728\u5de5\u5177\u53c2\u6570\u4e2d\u4f20\u9012\u5bfc\u822a\u9009\u9879<br \/>\n  \/\/ \u8fd9\u53d6\u51b3\u4e8e\u5177\u4f53\u7684\u670d\u52a1\u5668\u5b9e\u73b0\u3002\u5982\u679c\u652f\u6301&#xff0c;\u53ef\u80fd\u901a\u8fc7\u4e00\u4e2a\u989d\u5916\u7684\u5b57\u6bb5\u5982&#096;navigationOptions&#096;\u4f20\u9012<br \/>\n  \/\/ \u4f8b\u5982&#xff1a;<br \/>\n  &#034;navigationOptions&#034;: {<br \/>\n    &#034;waitUntil&#034;: &#034;networkidle2&#034;, \/\/ \u7b49\u5f85\u5230\u7f51\u7edc\u57fa\u672c\u7a7a\u95f2<br \/>\n    &#034;timeout&#034;: 60000 \/\/ \u8d85\u65f6\u5ef6\u957f\u81f360\u79d2<br \/>\n  }<br \/>\n}<\/p>\n<p>\u63d0\u793a&#xff1a;waitUntil\u53c2\u6570\u975e\u5e38\u5173\u952e\u3002load\u4e8b\u4ef6\u89e6\u53d1\u8f83\u65e9&#xff0c;\u4f46\u9875\u9762\u53ef\u80fd\u8fd8\u5728\u5f02\u6b65\u52a0\u8f7d\u6570\u636e\u3002networkidle2&#xff08;500ms\u5185\u4e0d\u8d85\u8fc72\u4e2a\u7f51\u7edc\u8fde\u63a5&#xff09;\u6216domcontentloaded\u662f\u66f4\u53ef\u9760\u7684\u9009\u62e9&#xff0c;\u53d6\u51b3\u4e8e\u4f60\u7684\u573a\u666f\u3002<\/p>\n<p>\u89e3\u51b3\u65b9\u6848B&#xff1a;\u8bca\u65ad\u7f51\u7edc\u963b\u585e<br \/>\n\u5982\u679c\u8d85\u65f6\u9891\u7e41\u53d1\u751f&#xff0c;\u9700\u8981\u8bca\u65ad\u662f\u5426\u662f\u7f51\u7edc\u7b56\u7565\u95ee\u9898\u3002\u5728\u670d\u52a1\u5668\u542f\u52a8\u811a\u672c\u4e2d&#xff0c;\u6dfb\u52a0\u4e00\u4e2a\u7b80\u5355\u7684\u7f51\u7edc\u8fde\u901a\u6027\u6d4b\u8bd5\u3002<\/p>\n<p>\/\/ \u5728\u670d\u52a1\u5668\u521d\u59cb\u5316\u65f6\u8fd0\u884c<br \/>\nconst https &#061; require(&#039;https&#039;);<br \/>\nhttps.get(&#039;https:\/\/www.google.com&#039;, (res) &#061;&gt; {<br \/>\n  console.log(&#096;\u7f51\u7edc\u6d4b\u8bd5\u72b6\u6001\u7801: ${res.statusCode}&#096;);<br \/>\n}).on(&#039;error&#039;, (e) &#061;&gt; {<br \/>\n  console.error(&#096;\u7f51\u7edc\u6d4b\u8bd5\u5931\u8d25: ${e.message}&#096;);<br \/>\n  \/\/ \u8fd9\u53ef\u80fd\u610f\u5473\u7740\u9700\u8981\u914d\u7f6e\u4ee3\u7406\u6216\u5904\u7406\u9632\u706b\u5899\u89c4\u5219<br \/>\n});<\/p>\n<h4>5.2 \u5904\u7406\u4f01\u4e1a\u4ee3\u7406\u4e0eHTTPS\u62e6\u622a<\/h4>\n<p>\u5728\u4f01\u4e1a\u73af\u5883\u4e2d&#xff0c;\u51fa\u7ad9\u6d41\u91cf\u53ef\u80fd\u5fc5\u987b\u7ecf\u8fc7\u4ee3\u7406\u670d\u52a1\u5668&#xff0c;\u6216\u8005\u5b89\u5168\u8f6f\u4ef6\u4f1a\u62e6\u622aHTTPS\u6d41\u91cf\u8fdb\u884c\u5ba1\u67e5&#xff08;\u5b89\u88c5\u81ea\u5b9a\u4e49\u6839\u8bc1\u4e66&#xff09;\u3002<\/p>\n<ul>\n<li>\u914d\u7f6e\u6d4f\u89c8\u5668\u4ee3\u7406&#xff1a;\u901a\u8fc7launchOptions.args\u4e3aChromium\u8bbe\u7f6e\u4ee3\u7406\u3002{<br \/>\n  &#034;launchOptions&#034;: {<br \/>\n    &#034;args&#034;: [&#034;&#8211;proxy-server&#061;http:\/\/your-proxy:8080&#034;]<br \/>\n  }<br \/>\n}<\/p>\n<\/li>\n<li>\u5ffd\u7565HTTPS\u9519\u8bef&#xff1a;\u5bf9\u4e8e\u6d4b\u8bd5\u73af\u5883\u6216\u5185\u90e8\u4f7f\u7528&#xff0c;\u53ef\u4ee5\u5ffd\u7565\u8bc1\u4e66\u9519\u8bef&#xff0c;\u4f46\u8fd9\u4f1a\u964d\u4f4e\u5b89\u5168\u6027\u3002{<br \/>\n  &#034;launchOptions&#034;: {<br \/>\n    &#034;ignoreHTTPSErrors&#034;: true<br \/>\n  }<br \/>\n}<\/p>\n<\/li>\n<li>\u52a0\u8f7d\u81ea\u5b9a\u4e49\u8bc1\u4e66&#xff1a;\u5982\u679c\u516c\u53f8\u6709\u81ea\u5b9a\u4e49CA\u8bc1\u4e66&#xff0c;\u9700\u8981\u5c06\u5176\u4f20\u9012\u7ed9Chromium\u3002\u8fd9\u6bd4\u8f83\u590d\u6742&#xff0c;\u901a\u5e38\u9700\u8981\u5c06\u8bc1\u4e66\u6587\u4ef6\u653e\u5165\u5bb9\u5668&#xff0c;\u5e76\u901a\u8fc7&#8211;ignore-certificate-errors-spki-list\u7b49\u53c2\u6570\u6307\u5b9a\u3002<\/li>\n<\/ul>\n<h4>5.3 \u4f7f\u7528\u68c0\u67e5\u5668\u8fdb\u884c\u5b9e\u65f6\u7f51\u7edc\u76d1\u63a7<\/h4>\n<p>\u8fd9\u662f\u6700\u5f3a\u5927\u7684\u8c03\u8bd5\u624b\u6bb5\u3002\u5728\u542f\u52a8Puppeteer MCP\u670d\u52a1\u5668\u65f6&#xff0c;\u4e0d\u8981\u4f7f\u7528\u65e0\u5934\u6a21\u5f0f&#xff0c;\u5e76\u542f\u7528DevTools\u7aef\u53e3\u3002<\/p>\n<p># \u542f\u52a8\u670d\u52a1\u5668&#xff0c;\u5e76\u6307\u5b9a\u4e00\u4e2a\u8fdc\u7a0b\u8c03\u8bd5\u7aef\u53e3<br \/>\nnpx &#064;modelcontextprotocol\/server-puppeteer &#8212; &#8211;remote-debugging-port&#061;9222<\/p>\n<p>\u7136\u540e&#xff0c;\u4f60\u53ef\u4ee5\u5728\u672c\u5730\u7684Chrome\u6d4f\u89c8\u5668\u4e2d\u6253\u5f00chrome:\/\/inspect&#xff0c;\u70b9\u51fb\u201cConfigure\u201d\u6dfb\u52a0localhost:9222&#xff0c;\u5c31\u80fd\u770b\u5230\u5e76\u8fde\u63a5\u5230\u8fdc\u7a0b\u7684\u6d4f\u89c8\u5668\u5b9e\u4f8b\u3002\u4f60\u53ef\u4ee5\u50cf\u8c03\u8bd5\u672c\u5730\u9875\u9762\u4e00\u6837&#xff0c;\u4f7f\u7528Network\u9762\u677f\u67e5\u770b\u6bcf\u4e00\u4e2a\u8bf7\u6c42\u7684\u72b6\u6001\u3001\u8017\u65f6\u548c\u54cd\u5e94\u5185\u5bb9&#xff0c;\u7cbe\u51c6\u5b9a\u4f4d\u662f\u54ea\u4e2a\u8d44\u6e90\u88ab\u963b\u585e\u6216\u52a0\u8f7d\u7f13\u6162\u3002<\/p>\n<p>\u8fd9\u79cd\u201c\u53ef\u89c6\u5316\u201d\u7684\u8c03\u8bd5\u65b9\u5f0f&#xff0c;\u5bf9\u4e8e\u89e3\u51b3\u590d\u6742\u7684\u9875\u9762\u4ea4\u4e92\u548c\u7f51\u7edc\u95ee\u9898&#xff0c;\u8fdc\u6bd4\u67e5\u770b\u65e5\u5fd7\u548c\u731c\u6d4b\u6709\u6548\u5f97\u591a\u3002\u5b83\u8ba9\u4f60\u80fd\u76f4\u63a5\u770b\u5230\u6d4f\u89c8\u5668\u770b\u5230\u7684\u4e16\u754c&#xff0c;\u800c\u4e0d\u4ec5\u4ec5\u662f\u670d\u52a1\u5668\u62a5\u544a\u7684\u7ed3\u679c\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u907f\u5f00\u8fd95\u4e2a\u5751&#xff01;Puppeteer MCP\u670d\u52a1\u5668\u8c03\u8bd5\u6307\u5357&#xff08;\u9644\u5e38\u89c1\u62a5\u9519\u89e3\u51b3\u65b9\u6848&#xff09;<br \/>\n\u8c03\u8bd5Puppeteer MCP\u670d\u52a1\u5668&#xff0c;\u5c31\u50cf\u662f\u5728\u4e00\u4e2a\u590d\u6742\u7684\u673a\u68b0\u8ff7\u5bab\u91cc\u5bfb\u627e\u90a3\u6839\u677e\u52a8\u7684\u87ba\u4e1d\u3002\u8868\u9762\u4e0a\u770b&#xff0c;\u4e00\u5207\u90fd\u5728\u8fd0\u884c\u2014\u2014\u6d4f\u89c8\u5668\u542f\u52a8\u4e86&#xff0c;\u5de5\u5177\u5217\u8868\u663e\u793a\u4e86&#xff0c;\u4f46\u5f53\u4f60\u6ee1\u6000\u671f\u5f85\u5730\u53d1\u9001\u7b2c\u4e00\u4e2a\u5bfc\u822a\u6307\u4ee4\u65f6&#xff0c;\u5374\u53ef\u80fd\u906d\u9047\u6d4f\u89c8\u5668\u7a97\u53e3\u4e00\u7247\u7a7a\u767d&#xff0c;\u6216\u8005\u63a7\u5236\u53f0\u7a81\u7136\u629b\u51fa\u4e00\u4e32\u4ee4\u4eba\u8d39\u89e3\u7684\u9519\u8bef\u4fe1\u606f\u3002\u5bf9\u4e8e\u4e2d\u9ad8\u7ea7\u5f00\u53d1\u8005\u6765\u8bf4&amp;#<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[8516,8518,8517,2929],"topic":[],"class_list":["post-77487","post","type-post","status-publish","format-standard","hentry","category-server","tag-puppeteer","tag-8518","tag-8517","tag-mcp"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u907f\u5f00\u8fd95\u4e2a\u5751\uff01Puppeteer MCP\u670d\u52a1\u5668\u8c03\u8bd5\u6307\u5357\uff08\u9644\u5e38\u89c1\u62a5\u9519\u89e3\u51b3\u65b9\u6848\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/77487.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u907f\u5f00\u8fd95\u4e2a\u5751\uff01Puppeteer MCP\u670d\u52a1\u5668\u8c03\u8bd5\u6307\u5357\uff08\u9644\u5e38\u89c1\u62a5\u9519\u89e3\u51b3\u65b9\u6848\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u907f\u5f00\u8fd95\u4e2a\u5751&#xff01;Puppeteer MCP\u670d\u52a1\u5668\u8c03\u8bd5\u6307\u5357&#xff08;\u9644\u5e38\u89c1\u62a5\u9519\u89e3\u51b3\u65b9\u6848&#xff09; \u8c03\u8bd5Puppeteer MCP\u670d\u52a1\u5668&#xff0c;\u5c31\u50cf\u662f\u5728\u4e00\u4e2a\u590d\u6742\u7684\u673a\u68b0\u8ff7\u5bab\u91cc\u5bfb\u627e\u90a3\u6839\u677e\u52a8\u7684\u87ba\u4e1d\u3002\u8868\u9762\u4e0a\u770b&#xff0c;\u4e00\u5207\u90fd\u5728\u8fd0\u884c\u2014\u2014\u6d4f\u89c8\u5668\u542f\u52a8\u4e86&#xff0c;\u5de5\u5177\u5217\u8868\u663e\u793a\u4e86&#xff0c;\u4f46\u5f53\u4f60\u6ee1\u6000\u671f\u5f85\u5730\u53d1\u9001\u7b2c\u4e00\u4e2a\u5bfc\u822a\u6307\u4ee4\u65f6&#xff0c;\u5374\u53ef\u80fd\u906d\u9047\u6d4f\u89c8\u5668\u7a97\u53e3\u4e00\u7247\u7a7a\u767d&#xff0c;\u6216\u8005\u63a7\u5236\u53f0\u7a81\u7136\u629b\u51fa\u4e00\u4e32\u4ee4\u4eba\u8d39\u89e3\u7684\u9519\u8bef\u4fe1\u606f\u3002\u5bf9\u4e8e\u4e2d\u9ad8\u7ea7\u5f00\u53d1\u8005\u6765\u8bf4&amp;#\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/77487.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-02-24T11:50:21+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/77487.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/77487.html\",\"name\":\"\u907f\u5f00\u8fd95\u4e2a\u5751\uff01Puppeteer MCP\u670d\u52a1\u5668\u8c03\u8bd5\u6307\u5357\uff08\u9644\u5e38\u89c1\u62a5\u9519\u89e3\u51b3\u65b9\u6848\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-02-24T11:50:21+00:00\",\"dateModified\":\"2026-02-24T11:50:21+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/77487.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/77487.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/77487.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u907f\u5f00\u8fd95\u4e2a\u5751\uff01Puppeteer MCP\u670d\u52a1\u5668\u8c03\u8bd5\u6307\u5357\uff08\u9644\u5e38\u89c1\u62a5\u9519\u89e3\u51b3\u65b9\u6848\uff09\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u907f\u5f00\u8fd95\u4e2a\u5751\uff01Puppeteer MCP\u670d\u52a1\u5668\u8c03\u8bd5\u6307\u5357\uff08\u9644\u5e38\u89c1\u62a5\u9519\u89e3\u51b3\u65b9\u6848\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/77487.html","og_locale":"zh_CN","og_type":"article","og_title":"\u907f\u5f00\u8fd95\u4e2a\u5751\uff01Puppeteer MCP\u670d\u52a1\u5668\u8c03\u8bd5\u6307\u5357\uff08\u9644\u5e38\u89c1\u62a5\u9519\u89e3\u51b3\u65b9\u6848\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u907f\u5f00\u8fd95\u4e2a\u5751&#xff01;Puppeteer MCP\u670d\u52a1\u5668\u8c03\u8bd5\u6307\u5357&#xff08;\u9644\u5e38\u89c1\u62a5\u9519\u89e3\u51b3\u65b9\u6848&#xff09; \u8c03\u8bd5Puppeteer MCP\u670d\u52a1\u5668&#xff0c;\u5c31\u50cf\u662f\u5728\u4e00\u4e2a\u590d\u6742\u7684\u673a\u68b0\u8ff7\u5bab\u91cc\u5bfb\u627e\u90a3\u6839\u677e\u52a8\u7684\u87ba\u4e1d\u3002\u8868\u9762\u4e0a\u770b&#xff0c;\u4e00\u5207\u90fd\u5728\u8fd0\u884c\u2014\u2014\u6d4f\u89c8\u5668\u542f\u52a8\u4e86&#xff0c;\u5de5\u5177\u5217\u8868\u663e\u793a\u4e86&#xff0c;\u4f46\u5f53\u4f60\u6ee1\u6000\u671f\u5f85\u5730\u53d1\u9001\u7b2c\u4e00\u4e2a\u5bfc\u822a\u6307\u4ee4\u65f6&#xff0c;\u5374\u53ef\u80fd\u906d\u9047\u6d4f\u89c8\u5668\u7a97\u53e3\u4e00\u7247\u7a7a\u767d&#xff0c;\u6216\u8005\u63a7\u5236\u53f0\u7a81\u7136\u629b\u51fa\u4e00\u4e32\u4ee4\u4eba\u8d39\u89e3\u7684\u9519\u8bef\u4fe1\u606f\u3002\u5bf9\u4e8e\u4e2d\u9ad8\u7ea7\u5f00\u53d1\u8005\u6765\u8bf4&amp;#","og_url":"https:\/\/www.wsisp.com\/helps\/77487.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-02-24T11:50:21+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"6 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/77487.html","url":"https:\/\/www.wsisp.com\/helps\/77487.html","name":"\u907f\u5f00\u8fd95\u4e2a\u5751\uff01Puppeteer MCP\u670d\u52a1\u5668\u8c03\u8bd5\u6307\u5357\uff08\u9644\u5e38\u89c1\u62a5\u9519\u89e3\u51b3\u65b9\u6848\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-02-24T11:50:21+00:00","dateModified":"2026-02-24T11:50:21+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/77487.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/77487.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/77487.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u907f\u5f00\u8fd95\u4e2a\u5751\uff01Puppeteer MCP\u670d\u52a1\u5668\u8c03\u8bd5\u6307\u5357\uff08\u9644\u5e38\u89c1\u62a5\u9519\u89e3\u51b3\u65b9\u6848\uff09"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/77487","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=77487"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/77487\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=77487"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=77487"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=77487"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=77487"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}