{"id":158957,"date":"2020-09-20T07:11:54","date_gmt":"2020-09-19T23:11:54","guid":{"rendered":"http:\/\/4563.org\/?p=158957"},"modified":"2020-09-20T07:11:54","modified_gmt":"2020-09-19T23:11:54","slug":"%e5%88%86%e4%ba%ab%e4%b8%80%e4%b8%aa%e7%94%a8%e4%ba%8e%e8%87%aa%e5%8a%a8%e5%8c%96%e5%92%8c%e7%88%ac%e8%99%ab%e7%9a%84%e5%ba%93","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=158957","title":{"rendered":"\u5206\u4eab\u4e00\u4e2a\u7528\u4e8e\u81ea\u52a8\u5316\u548c\u722c\u866b\u7684\u5e93"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u5206\u4eab\u4e00\u4e2a\u7528\u4e8e\u81ea\u52a8\u5316\u548c\u722c\u866b\u7684\u5e93               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : ysmood <\/span>  <span><i><\/i> 2<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u9879\u76ee\u5730\u5740\uff1a https:\/\/github.com\/go-rod\/rod<\/p>\n<p>\u611f\u8c22\u5927\u5bb6\u7684\u53cd\u9988\u4f18\u5316\u4e86\u4e0d\u5c11 API\uff0c\u56e0\u4e3a\u4e4b\u524d\u7684\u5e16\u5b50\u5df2\u7ecf\u8fc7\u65f6\u4e86\uff0c\u6240\u4ee5\u5728\u8fd9\u91cc\u91cd\u65b0\u53d1\u4e0b\u5e16\u5b50\u3002\u8fd1\u671f\u4e3b\u8981\u4f18\u5316\u4e86\u5f02\u5e38\u5904\u7406\u3002\u57fa\u672c\u8986\u76d6\u4e86 puppeteer \u7684\u4e3b\u8981\u529f\u80fd\uff0c\u4e14\u652f\u6301\u66f4\u591a\u4fbf\u5229\u7684\u9ad8\u7ea7\u529f\u80fd\uff0c\u6bd4\u5982\u7b49\u5f85 ajax\uff0c\u590d\u6742\u4ee3\u7406\uff0c\u6587\u4ef6\u4e0b\u8f7d\u7b49\u3002<\/p>\n<p>\u8fd9\u4e2a\u5e93\u7684\u4e3b\u8981\u539f\u7406\u5c31\u662f\u5229\u7528\u6d4f\u89c8\u5668\u7684 devtools \u53ef\u7f16\u7a0b\u63a5\u53e3\u6765\u64cd\u63a7\u6d4f\u89c8\u5668\u3002\u65e5\u5e38\u4f60\u53ef\u4ee5\u7528\u5b83\u81ea\u52a8\u5316\u4e00\u4e9b\u91cd\u590d\u7684\u9875\u9762\u4efb\u52a1\uff0c\u76f8\u6bd4\u6cb9\u7334\u5b50\u6709\u66f4\u591a\u7684\u9ad8\u7ea7\u529f\u80fd\u548c golang \u5f3a\u5927\u7684\u751f\u6001\u3002\u5de5\u4f5c\u4e0a\u53ef\u4ee5\u7528\u5b83\u8f85\u52a9\u96c6\u6210\u5316\u6d4b\u8bd5\u51cf\u5c11\u4eba\u529b\u6d88\u8017\u3002\u5f00\u53d1\u4e0a\u53ef\u4ee5\u7528\u5b83\u7b80\u5316\u4e00\u4e9b\u4f20\u7edf\u722c\u866b\u9700\u8981\u8d39\u5f88\u591a\u65f6\u95f4\u9006\u5411\u5de5\u7a0b\u7684\u573a\u666f\u3002<\/p>\n<p>\u6b22\u8fce\u5bf9\u81ea\u52a8\u5316\u6709\u5174\u8da3\u7684\u670b\u53cb\u52a0\u5165\u5230\u9879\u76ee\u4e2d\u6765\uff0c\u8fd9\u662f\u6211\u4eec\u7684\u804a\u5929\u5ba4\uff1a https:\/\/discord.gg\/PAaMGJw<\/p>\n<p>\u53ef\u4ee5\u901a\u8fc7\u793a\u4f8b\u6587\u4ef6\u5927\u81f4\u4e86\u89e3 rod \u7684\u4e00\u4e9b\u57fa\u672c\u7528\u6cd5\uff1a https:\/\/github.com\/go-rod\/rod\/blob\/master\/examples_test.go<\/p>\n<p>\u4e0b\u56fe\u662f rod\uff0cpuppeteer \u548c chromedp \u5b9e\u73b0\u76f8\u540c\u8f93\u51fa\u7684\u4ee3\u7801\u5bf9\u6bd4\uff1a<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/4563.org\/wp-content\/uploads\/2020\/09\/20200923_5f6b7c6d29b73.jpg\" alt=\"\u5206\u4eab\u4e00\u4e2a\u7528\u4e8e\u81ea\u52a8\u5316\u548c\u722c\u866b\u7684\u5e93\" \/><\/p>\n<p>\u66f4\u591a\u5bf9\u6bd4\u8bf7\u79fb\u6b65\uff1a https:\/\/github.com\/go-rod\/rod\/tree\/master\/lib\/examples\/compare-chromedp<\/p>\n<p>\u5173\u4e8e Must \u524d\u7f00: https:\/\/github.com\/go-rod\/rod\/blob\/03b1d54362f72599d3bfa465aee6b48c9c51599b\/examples_test.go#L137-L186<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>49<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"3411506\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : ysmood <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6bd4\u5982\u8fd9\u4e24\u5929\u6211\u5c06\u7528 rod \u6bcf\u5c0f\u65f6\u81ea\u52a8\u7f6e\u9876\u4e00\u6b21\u8fd9\u4e2a\u5e16\u5b50\uff0c\u793a\u4f8b\u9879\u76ee\uff1a https:\/\/github.com\/go-rod\/v2ex-example                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3411507\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : playniuniu <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u975e\u5e38\u597d\u7528 \u652f\u6301\u4e00\u4e0b                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3411508\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : playniuniu <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u53e6\u5916 \u80fd\u5426\u51fa\u4e00\u4e2a\u8be6\u7ec6\u4e00\u70b9\u7684\u6587\u6863 \u76f4\u63a5\u770b example test \u4ee3\u7801\u8fd8\u662f\u6709\u70b9\u8d39\u52b2                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3411509\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : supermoonie <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u9700\u8981\u591a\u5c11\u7ebf\u7a0b\u652f\u6301\u4e00\u4e2a tab \uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3411510\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : ysmood <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @supermoonie \u597d\u5947\u4f60\u8fd9\u4e2a\u95ee\u9898\u7684\u51fa\u53d1\u70b9\u662f\u5565\u3002\u8981\u5728\u5355\u6838 CPU \u4e0a\u8dd1\u5417\uff1f\u7406\u8bba\u4e0a\u7528\u4e86 Go \u4e00\u4e2a\u7ebf\u7a0b\u5c31\u591f\u4e86 (green threads)\uff0c\u4e0d\u662f\u5f88\u6e05\u695a\u8be5\u5982\u4f55\u56de\u7b54\u4f60\u8fd9\u4e2a\u95ee\u9898\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3411511\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : ysmood <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @playniuniu \u786e\u5b9e\uff0c\u76ee\u524d\u8fd8\u6ca1\u6709\u6559\u7a0b\uff0c\u611f\u89c9\u6700\u8fd1\u53ef\u80fd\u4f1a\u82b1\u70b9\u65f6\u95f4\u51fa\u70b9\u6559\u7a0b\uff0c\u6bd4\u5982\u5f55\u4e2a\u89c6\u9891\u6216\u8005\u76f4\u64ad\u4e4b\u7c7b\u7684\u4f1a\u5bf9\u6211\u6765\u8bf4\u8d1f\u62c5\u5c0f\u70b9\uff0c\u5199\u6587\u7ae0\u6bd4\u8f83\u8d39\u7cbe\u529b\u3002\u786e\u5b9e\u662f\u60f3\u6536\u96c6\u5927\u5bb6\u7684\u60f3\u6cd5\u624d\u53d1\u5e16\u5b50\u7684\uff0c\u6709\u4ec0\u4e48\u5177\u4f53\u60f3\u5b66\u7684\u5417\uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3411512\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : playniuniu <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5982\u679c\u6709\u53ef\u80fd \u80fd\u5426\u627e\u51e0\u4e2a\u7f51\u7ad9 \u4ece\u6700\u7b80\u5355\u7684 \u89e3\u6790\u7f51\u9875\u8868\u5355 \uff0c\u64cd\u4f5c\u9f20\u6807\u70b9\u51fb \u5230\u6bd4\u8f83\u590d\u6742\u7684\u8fc7\u6ed1\u52a8\u9a8c\u8bc1\u7801 eval js \u7b49\u7b49 \u8fd8\u6709\u6bd4\u8f83\u9a9a\u64cd\u4f5c\u7684 hijack \u8bf7\u6c42 bypass \u8fd9\u4e9b \u6bcf\u4e00\u4e2a\u80fd\u7ed9\u4e2a\u6848\u4f8b\u5e76\u8bb2\u89e3\u4e00\u4e0b rod \u5b9e\u73b0\u539f\u7406\u5c31\u597d\u4e86                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3411513\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : ysmood <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @playniuniu \u597d\u7684\uff0c\u5e94\u8be5\u95ee\u9898\u4e0d\u5927\u3002\u8fd8\u4f1a\u8bb2\u89e3\u4e0b\u5982\u4f55\u5229\u7528 rod \u8c03\u8bd5\u590d\u6742\u573a\u666f\uff0c\u8fd9\u4e2a\u4e5f\u662f\u5f88\u591a\u4eba\u5e38\u5e38\u95ee\u7684\uff0c\u8fd9\u79cd\u5c31\u5f88\u96be\u5199\u6587\u7ae0\uff0c\u4e0d\u5f55\u5c4f\u5e55\u592a\u9ebb\u70e6\u89e3\u91ca\u4e86\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3411514\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : xwhxbg <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u662f\u6211\u706b\u661f\u4e86\u8fd8\u662f promise \u4e0d\u652f\u6301 timeout \u4e86\uff1f Pupeteer \u4e0d\u652f\u6301 abort slow operation\uff0c\u8fd9\u4e2a\u4e0d\u662f\u7528 promise timeout \u5c01\u88c5\u4e00\u4e0b\u5c31\u884c\u4e86\u4e48\uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3411515\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : ysmood <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @xwhxbg \u6211\u662f\u81ea\u5df1\u5b9e\u73b0\u8fc7 promise \u5e93\u7684\uff0c\u7814\u7a76\u4e86\u5f88\u591a nodejs \u5e95\u5c42\u5de5\u4f5c\u539f\u7406\u7684\uff1a https:\/\/github.com\/ysmood\/yaku<\/p>\n<p>\u8fd9\u8bf4\u6cd5\u5176\u5b9e\u662f\u5bf9\u6bd4\u4e8e Go \u7684 context \u7279\u6027\u6765\u8bf4\u7684\u3002\u5927\u81f4\u5c31\u662f\u6307\uff0c\u6bd4\u5982\u4e00\u4e2a operation \u8981\u8017\u8d39\u4e00\u4e2a\u5c0f\u65f6\uff0c\u5982\u679c\u4f60\u7528 nodejs \u7684 promise\uff0c\u5b9e\u9645\u4e0a\u8fd9\u4e2a operation \u76f8\u5173\u7684\u8d44\u6e90\u8fd8\u662f\u9a7b\u7559\u5728\u5185\u5b58\u7684\uff0c\u5e76\u6ca1\u6709 abort \u91ca\u653e\uff0c\u53ea\u6709\u5230\u4e00\u4e2a\u5c0f\u65f6\u540e\u624d\u4f1a\u91ca\u653e\u3002\u6bd4\u5982 cdp \u7684\u901a\u4fe1\uff0c\u7531\u4e8e\u662f\u57fa\u4e8e websocket \u7684 frame\uff0cpuppeteer \u5e76\u6ca1\u6709\u5b9e\u73b0\u539f\u5b50\u7ea7\u522b\u7684 abort \u3002\u4f60\u8981\u60f3\u91ca\u653e\u5355\u4e2a\u8bf7\u6c42\u53ea\u80fd\u65ad\u5f00\u6574\u4e2a websocket \u94fe\u63a5\uff0c\u800c rod \u8fd9\u79cd\u5c31\u4e0d\u7528\u4e86\uff0c\u53ef\u4ee5\u5f88\u539f\u5b50\u7684\u64cd\u4f5c\u7ec6\u8282\u3002                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3411516\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : ysmood <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @xwhxbg \u6bd4\u5982\u8fd9\u4e2a\u4f8b\u5b50 https:\/\/github.com\/ysmood\/yaku\/issues\/37                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3411517\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : xwhxbg <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @ysmood \u5443\uff0c\u5927\u5bb6\u4e0d\u90fd\u662f\u7528 bluebird \u5bb6\u7684 promise \u5b9e\u73b0\u4e48\uff1f ES6 \u7684\u786e\u5b9e\u6ca1\u6cd5 cancel\uff0c\u4f46\u662f bluebird \u5bb6\u7684\u6709 abort \u4e4b\u7c7b\u7684                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3411518\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : daizige <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6301\u7eed\u5173\u6ce8\u4e2d \u611f\u89c9\u4f1a\u5f88\u6709\u610f\u601d                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3411519\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : ysmood <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @xwhxbg \u6240\u4ee5\u4f60\u5f97\u53bb\u4e86\u89e3 abort \u7684\u5e95\u5c42\u673a\u5236\uff0cbluebird \u4e5f\u6ca1\u6cd5\u89e3\u51b3\u6211\u8bf4\u7684\u95ee\u9898\uff0c\u5b83\u7684 abort \u5bf9\u6211\u6765\u8bf4\u90fd\u662f\u865a\u5047\u7684 abort\uff0c\u5b9e\u9645\u8fd8\u662f\u5728\u540e\u53f0\u6d88\u8017\u8d44\u6e90\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3411520\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : ysmood <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @xwhxbg golang \u8d2f\u7a7f\u6574\u4e2a\u7cfb\u7edf\u5e95\u5c42\u7684 context \u6982\u5ff5\u662f nodejs \u662f\u5f88\u96be\u6bd4\u62df\u7684: https:\/\/golang.org\/pkg\/context\/<\/p>\n<p>Promise \u8bbe\u8ba1\u4e4b\u521d\u538b\u6839\u5c31\u6ca1\u597d\u597d\u8003\u8651 abort\uff0c\u8349\u6848\u76f4\u63a5\u653e\u5f03\u4e86\u8fd9\u4e2a\u65b9\u5411\u7684\u63a2\u5bfb\u3002<\/p>\n<p>\u5199 puppeteer \u5927\u91cf\u91cd\u590d\u7684 async await \u53cd\u590d\u6a2a\u8df3\u4e8e\u4ee3\u7801\u95f4\u3002\u6709\u65f6\u5019\u5199\u6f0f\u4e86 await \u8fd8\u4e0d\u5bb9\u6613\u5bdf\u89c9\u3002\u6211\u4e2a\u4eba\u89c9\u5f97\u4e25\u91cd\u7834\u574f\u4e86\u7528 IDE \u81ea\u52a8\u70b9\u70b9\u70b9\u8865\u5168\u7684\u6d41\u7545\u611f\u3002                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3411521\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : xwhxbg <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @ysmood \u6211\u5b9e\u5728\u662f\u6ca1\u770b\u61c2\u4f60\u8bf4\u7684\u201c\u5e95\u5c42\u673a\u5236\u201d\u662f\u4ec0\u4e48\uff0c\u5982\u679c\u60f3\u8981 cancel \u8bf7\u6c42\uff0ces6 \u5c31\u6709 abort\uff0c\u5982\u679c\u60f3\u8981 then \u91cc\u9762\u76f4\u63a5\u8df3\u8fc7\uff0c\u7acb\u523b\u56de\u6536\u5185\u5b58\uff0cbluebird \u4e5f\u80fd\u5b9e\u73b0                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3411522\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : xwhxbg <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @ysmood context \u53ea\u662f\u4e00\u4e2a handle \u800c\u5df2\u554a\uff0c\u8d2f\u7a7f\u5e95\u5c42\u662f\u6307\u4ec0\u4e48\u5462\uff1f promise \u4f20\u4e00\u4e2a object \u5f53 handle \u4e5f\u662f\u53ef\u4ee5\u7684\u554a\u3002<\/p>\n<p>golang \u7684 cancel \u5c31\u662f\u5f88\u6b63\u5e38\u7684\u4e00\u4e2a handle\uff0c\u6587\u6863\u4e5f\u8bf4\u4e86`A CancelFunc does not wait for the work to stop. `\u8bf4\u660e\u5373\u4f7f\u8c03\u7528\u4e86 cancel \u4e5f\u4e0d\u80fd\u8ba9\u4ee3\u7801\u7acb\u523b\u7ed3\u675f<\/p>\n<p>\u53ef\u4ee5\u63cf\u8ff0\u4e00\u4e0b\u4f60\u60f3\u8981\u7684 cancel \u662f\u4ec0\u4e48\u6548\u679c\u5417\uff1f                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3411523\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : ysmood <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @xwhxbg \u8fd9\u4e2a google \u4e00\u4e0b\u7c7b\u4f3c\u5173\u952e\u5b57\u90fd\u53ef\u4ee5\u51fa\u7ed3\u679c\uff1a https:\/\/stackoverflow.com\/questions\/29478751\/cancel-a-vanilla-ecmascript-6-promise-chain<\/p>\n<p>\u4f60\u770b\u8fd9\u4e2a\u4eba\u8bf4 bluebird \u53ef\u4ee5\uff0c\u7136\u540e\u8bc4\u8bba\u7684\u4eba\u5c31\u8bf4\u7684\u5f88\u6e05\u695a\u4e86\uff1a<\/p>\n<p>this definition of canceled is just rejecting the promise. it depends on the definition of &#8220;canceled&#8221;<\/p>\n<p>This is partially right, but if you have long promise chain, this approach would not work.<\/p>\n<p>\u6211\u89c9\u633a\u6e05\u695a\u4e86\u554a\uff0c\u5404\u79cd\u4eba\u90fd\u8ba8\u8bba\u8fc7\u8fd9\u4e2a\u95ee\u9898\u3002<\/p>\n<p>\u4f60\u8bf4 \u201des6 \u5c31\u6709 abort\u201c\uff0c\u80fd\u7ed9\u4e2a ES6 \u5b98\u65b9\u7684 spec \u94fe\u63a5 \u5417\uff1f\u6211\u597d\u5947\u5565\u65f6\u5019\u51fa\u7684                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3411524\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : xwhxbg <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @ysmood https:\/\/stackoverflow.com\/questions\/31061838\/how-do-i-cancel-an-http-fetch-request<\/p>\n<p>\u6211\u4e0d\u592a\u7406\u89e3\uff0c\u5373\u4f7f\u6ca1\u6709 bluebird\uff0c\u5199\u4e00\u4e2a\u5e26 handle \u7684 cancel \u4e5f\u662f\u5f88\u5bb9\u6613\u7684\u4e8b\u60c5<\/p>\n<p>&#8220;`javascript<br \/>let handle = { cancel: false};<\/p>\n<p>let result = dosomething(handle).then(handle=&gt;{<br \/>if (handle.cancel){<br \/>throw(&#8220;cancel error&#8221;);<br \/>}<br \/>});<\/p>\n<p>&#8230;<\/p>\n<p>function cancel(){<br \/>handle.cancel = true;<br \/>}<br \/>&#8220;`                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3411525\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : supermoonie <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @ysmood \u7528 java \u5b9e\u73b0\u8fc7\u8fd9\u4e2a\u534f\u8bae\uff0c\u56e0\u4e3a\u6ca1\u6709\u7528\u5f02\u6b65 io\uff0cwebsocket \u53d1\u9001\u4e00\u4e2a\u7ebf\u7a0b\uff0c\u63a5\u6536\u4e00\u4e2a\u7ebf\u7a0b\uff0c\u4e8b\u4ef6\u5904\u7406\u4e5f\u662f\u4e00\u4e2a\u7ebf\u7a0b\u6c60\u5728\u652f\u6301\uff0c\u6240\u4ee5\u95ee\u4e0b go \u5b9e\u73b0\u7684\u8bdd\uff0c\u662f\u4e0d\u662f\u50cf node \u90a3\u6837\u57fa\u4e8e\u4e8b\u4ef6\u5904\u7406\uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3411526\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : ysmood <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @xwhxbg abort \u662f\u4e0d\u53ef\u80fd\u7531\u5916\u90e8\u72ec\u7acb\u5b8c\u6210\u7684\uff0c\u5fc5\u7136\u662f\u8981 task \u81ea\u5df1\u8f6e\u8be2\u662f\u5426\u6709\u4e2d\u65ad\u673a\u4fe1\u53f7\uff0c\u8fd9\u4e2a\u662f\u8ba1\u7b97\u673a\u539f\u7406\u7684\u57fa\u7840\u3002promise \u662f task \u81ea\u5df1\u8fd4\u56de\u4e00\u4e2a\u627f\u8bfa\uff0c\u800c golang context \u662f\u5411 task \u4f20\u9012\u4e2d\u65ad\u4fe1\u53f7\u3002\u8fd9\u4e2a\u6839\u672c\u5dee\u5f02\u5f88\u96be\u7528\u4e00\u4e9b\u4e09\u65b9\u5e93\u62b9\u5e73\uff0c\u5fc5\u987b\u8981\u6539\u5f88\u591a\u5e93\u7684\u63a5\u53e3\u65b9\u5f0f\u3002puppeteer \u662f\u6ca1\u6709\u5b9e\u73b0\u8fd9\u79cd\u7ec6\u7c92\u5ea6\u4e2d\u65ad\u4fe1\u53f7\u63a7\u5236\u7684\u3002\u6240\u4ee5\u6211\u89c9\u5f97\u8fd9\u91cc\u6211\u8868\u8fbe\u7684\u5e94\u8be5\u8fd8\u7b97\u5408\u7406\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3411527\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : ysmood <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @xwhxbg \u6240\u4ee5\u95ee\u9898\u7684\u5173\u952e\u662f puppeteer \u6ca1\u7ed9\u4f60\u63a5\u53e3\u8ba9\u4f60\u4f20\u8fd9\u4e2a cancel \u7684\u4fe1\u53f7\u8fdb\u53bb\u554a\uff0c\u8fd9\u6837\u8bf4\u4f60\u89c9\u5f97\u8fd8\u6709\u95ee\u9898\u5417\uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3411528\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : xwhxbg <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @ysmood \u4f60\u7684\u610f\u601d\u662f golang \u53ef\u4ee5\u505a\u5230\u884c\u7ea7\u522b\u7684 cancel\uff0c\u80fd\u5728\u4e00\u4e2a function \u8c03\u7528\u4e00\u534a\u7684\u65f6\u5019\u4e0d\u6267\u884c\u4e0b\u534a\u90e8\u5206\u4e48\uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3411529\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : ysmood <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @supermoonie \u7528\u7684 goroutine \u4e0d\u662f libuv \u90a3\u79cd\u3002\u57fa\u4e8e go channel \u7684\u901a\u4fe1\uff0c\u4e0d\u662f epoll\uff0c\u5404\u6709\u4f18\u52a3\u3002\u4e0d\u4f1a\u50cf node \u90a3\u6837\u8981\u5404\u79cd\u4fa6\u542c\u4e8b\u4ef6\uff0c\u5199\u6cd5\u57fa\u672c\u662f\u7ebf\u6027\u7684\uff0c\u4e0d\u4f1a\u51fa\u73b0\u4e00\u5927\u5806 callback                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3411530\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : ysmood <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @xwhxbg \u6211\u521a\u4e0d\u662f\u8bf4\u4e86\u8ba1\u7b97\u673a\u539f\u7406\u4e86\u5417\uff1f \u5f53\u7136\u662f\u4e0d\u53ef\u4ee5\u7684\uff0c\u8fd9\u4e0d\u662f\u8981\u5bf9\u6bd4 golang \u548c nodejs\uff0c\u8fd9\u91cc\u53ea\u662f\u6bd4\u8f83 rod \u548c puppeteer \u5728\u5904\u7406 io block \u7684 cancel \u4e0a\u3002rod \u786e\u5b9e\u80fd\u66f4\u7ec6\u529b\u5ea6\u7684\u5904\u7406 cancel \u4fe1\u53f7\uff0c\u4efb\u4f55\u53ef\u4ee5 io block \u7684\u5730\u65b9\u57fa\u672c\u90fd\u53ef\u4ee5 cancel                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3411531\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : ysmood <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @xwhxbg \u6bd4\u5982 puppeteer \u5728\u6a21\u62df click \u65f6\uff0c\u4f1a\u53d1\u9001\u591a\u4e2a\u8bf7\u6c42\u5230 chrome\uff0c\u4f60\u6ca1\u6cd5\u963b\u6b62\u8fd9\u51e0\u4e2a\u8bf7\u6c42\u53ea\u53d1\u51fa\u53bb\u4e00\u534a\u3002rod \u53ef\u4ee5\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3411532\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : supermoonie <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @ysmood \u90a3\u6211\u6362\u79cd\u95ee\u6cd5\uff0c\u4e00\u4e2a Tab \u9700\u8981\u591a\u5c11\u4e2a goroutine \u652f\u6301\uff1f\u6211\u53ef\u80fd\u6bd4\u8f83\u5173\u6ce8\u6027\u80fd\u8fd9\u5757\uff0c\u56e0\u4e3a Chrome \u672c\u6765\u5c31\u6bd4\u8f83\u6d88\u8017\u8d44\u6e90                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3411533\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : ysmood <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @supermoonie \u76f8\u6bd4 chrome\uff0crod \u7684\u635f\u8017\u53ef\u4ee5\u5ffd\u7565\u4e0d\u8ba1\uff0c\u5c31\u7b97\u4f60\u5f00 100 \u4e2a tab \u4e5f\u53ea\u6709\u51e0\u4e2a goroutine\uff0cgoroutine \u6570\u548c tab \u6ca1\u6709\u5173\u7cfb\uff0crod \u4f7f\u7528\u4e86\u4e25\u683c\u7684 goleak \u6d4b\u8bd5\uff0c\u6781\u5927\u7684\u63a7\u5236\u4e86 goroutine \u7684\u6570\u91cf: https:\/\/github.com\/uber-go\/goleak                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3411534\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : supermoonie <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @ysmood \u4eca\u5929\u4e0b\u73ed\u4e86\u6211\u53bb\u770b\u770b\u4f60\u7684\u6e90\u7801\uff0c\u6ca1\u6709\u5f02\u6b65 IO \u7adf\u7136\u53ef\u4ee5\u505a\u5230\u53ea\u6709\u51e0\u4e2a goroutine\uff0c\u5f88\u597d\u5947\u662f\u600e\u4e48\u505a\u5230\u7684                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3411535\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : jzyzcz <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5b66\u4e60\u4e00\u4e0b&#8230;<br \/>\u6700\u8fd1\u4e5f\u5728\u7528 puppeteer \u505a\u722c\u866b\uff0c\u611f\u89c9\u8fd9\u4e2a\u53ef\u73a9\u6027\u975e\u5e38\u9ad8                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3411536\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : yejianmail <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5df2\u2b50\uff0c\u60f3\u627e\u4e2a Java \u7684 chrome cdp \u6ca1\u6709\u627e\u5230\u5408\u9002\u7684\uff0cselenium \u7528\u8d77\u6765\u611f\u89c9\u4e0d\u592a\u723d                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3411537\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : ysmood <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @supermoonie \u6b22\u8fce\u6765 review \u4ee3\u7801\u3002\u6709\u4efb\u4f55\u95ee\u9898\u90fd\u53ef\u4ee5\u53bb\u804a\u5929\u5ba4\uff1a https:\/\/discord.gg\/PAaMGJw                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3411538\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : supermoonie <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @yejianmail java \u6709 cdp4j\uff0c\u73b0\u5728\u597d\u50cf\u6709\u793e\u533a\u7248\uff0c\u4e0d\u8fc7\u4ee3\u7801\u5199\u7684\u4e0d\u662f\u592a\u597d\uff0c\u7ebf\u7a0b\u7ba1\u7406\u90fd\u6ca1\u6709                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3411539\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : supermoonie <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @ysmood review \u4e0d\u4e86\uff0c\u6bd5\u7adf\u4e0d\u662f\u641e go \u7684\uff0c\u51c6\u5907\u62bd\u65f6\u95f4\uff0c\u7528 java nio \u7684\u5c01\u88c5\u5e93 netty \u5199\u4e00\u904d\uff0c\u4e4b\u524d\u7528\u7684\u963b\u585e io\uff0c\u4e0d\u662f\u5f88\u6ee1\u610f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3411540\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : ysmood <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @yejianmail \u548c\u5176\u4ed6\u5e93\u7684\u6bd4\u8f83\uff0c\u91cc\u9762\u6709\u63d0\u5230 selenium\uff0c\u53ef\u80fd\u5bf9\u4f60\u6709\u5e2e\u52a9\uff1a https:\/\/github.com\/go-rod\/rod#q-why-another-puppeteer-like-lib                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3411541\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : ysmood <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @supermoonie \u5199\u901a\u4fe1\u5f02\u6b65\u5904\u7406\u8fd9\u5757\u7b97\u662f\u8fd9\u4e2a\u5e93\u6700\u5c0f\u513f\u79d1\u7684\u90e8\u5206\u4e86\u3002\u6838\u5fc3\u4ee3\u7801\u53ea\u6709 200 \u884c https:\/\/github.com\/go-rod\/rod\/blob\/03b1d54\/lib\/cdp\/client.go#L118<\/p>\n<p>\u8fd9\u4e2a\u9879\u76ee\u771f\u6b63\u96be\u7684\u662f\u5982\u4f55\u5728\u6ca1\u6709\u8be6\u7ec6\u6587\u6863\u548c\u8d44\u6599\u7684\u60c5\u51b5\u4e0b\u7528 cdp \u63a5\u53e3\u5b8c\u6210\u4e00\u4e9b\u9ad8\u7ea7\u529f\u80fd\uff0cchrome \u5b98\u65b9\u7684\u6587\u6863\u975e\u5e38\u7cdf\u7cd5\uff0c\u800c\u4e14 cdp \u63a5\u53e3\u8bbe\u8ba1\u672c\u8eab\u4e5f\u95ee\u9898\u5f88\u5927\u3002\u6bd4\u5982\u5355\u662f\u6a21\u62df\u5b8c\u7f8e\u7684 click \u90fd\u591f\u4f60\u6298\u817e\u4e00\u9635\u5b50\uff0c\u770b\u4f3c\u7b80\u5355\u7684 click \u9700\u8981\u8c03\u7528\u7ea6\u5341\u4e2a\u63a5\u53e3\u5b8c\u6210\uff0cchrome \u53ea\u5217\u4e3e\u4e86\u5168\u90e8\u63a5\u53e3\uff0c\u4f46\u662f\u8981\u8c03\u7528\u54ea 10 \u4e2a\u63a5\u53e3\u5b8c\u6210\u50cf\u4eba\u4e00\u6837\u70b9\u51fb\u9f20\u6807\u662f\u6ca1\u6709\u8bf4\u7684\u3002<\/p>\n<p>\u4f60\u8981\u662f\u611f\u5174\u8da3\uff0cgo \u633a\u7b80\u5355\u7684\uff0c\u6bd4\u8d77\u4f60\u53bb\u7814\u7a76 puppeteer\uff0c\u628a\u8fd9\u4e2a\u9879\u76ee\u7ffb\u8bd1\u6210 java \u4f30\u8ba1\u4f1a\u66f4\u7b80\u5355\u3002<\/p>\n<p>\u5176\u5b9e\u66f4\u597d\u7684\u505a\u6cd5\u4e0d\u662f\u7528\u5404\u79cd\u8bed\u8a00\u5b9e\u73b0\u4e00\u904d\u76f8\u540c\u7684\u529f\u80fd\uff0c\u800c\u662f\u57fa\u4e8e rod \u8fd9\u79cd\u5e93\u5f00\u53d1\u8bed\u8a00\u4e2d\u6027\u7684\u670d\u52a1\uff0c\u6211\u4eec\u6709\u4e2a issue \u4f60\u53ef\u4ee5\u770b\u770b\uff1a https:\/\/github.com\/go-rod\/rod\/issues\/21<\/p>\n<p>\u6211\u4eec\u4e5f\u6709\u4e2a\u8bed\u8a00\u4e2d\u6027\u5316\u7684\u8bd5\u9a8c\u6027\u9879\u76ee https:\/\/github.com\/go-rod\/wayang                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3411542\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : soseek <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             https:\/\/github.com\/microsoft\/playwright-cli <\/p>\n<p>\u80fd\u505a\u5230\u8fd9\u79cd\u5c31\u6e9c\u4e86                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3411543\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : ysmood <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @soseek \u8fd9\u79cd\u9879\u76ee\u633a\u591a\u7684 rod \u4e5f\u6709\u76f8\u5173 issue\uff0c\u6211\u4eec\u662f\u6709\u8ba1\u5212\u8981\u505a\u8fd9\u4e2a\u7684\uff1a <\/p>\n<p>https:\/\/github.com\/go-rod\/rod\/issues\/139<\/p>\n<p>https:\/\/github.com\/go-rod\/rod\/issues\/81<\/p>\n<p>\u6211\u662f\u60f3\u6307\u5bfc\u4e2a\u5bf9\u8fd9\u65b9\u9762\u611f\u5174\u8da3\u7684\u5b66\u751f\u6216\u8005\u5f00\u53d1\u8005\u6765\u505a\u4e2a\u72ec\u7acb\u9879\u76ee\u3002\u5b9e\u9645\u9879\u76ee\u80fd\u4f7f\u7528\u7684\u8303\u56f4\u4e0d\u5927\uff0c\u7a0d\u5fae\u590d\u6742\u70b9\u7684\u7f51\u7ad9\u90fd\u5f88\u96be\u5f55\u5236\u3002\u4f46\u662f\u4f5c\u4e3a\u5174\u8da3\u9879\u76ee\u662f\u975e\u5e38\u6709\u6311\u6218\u4ef7\u503c\u7684\u3002                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3411544\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : ysmood <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @soseek \u6bd4\u5982\u8bbe\u8ba1 \u201c\u6700\u77ed\u9009\u62e9\u5668\u641c\u7d22\u7b97\u6cd5&#8221; \uff0c\u5bf9\u4e8e\u60f3\u6311\u6218\u7684\u4eba\u5e94\u8be5\u8fd8\u633a\u6709\u8da3\u7684\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3411545\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : supermoonie <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @ysmood emmm \u3002\u3002\u3002\u5f02\u6b65\u901a\u4fe1\u5bf9\u4e8e go \u53ef\u80fd\u7b80\u5355\uff0c\u4f46\u662f\u5bf9\u4e8e Java \u6765\u8bf4\u5374\u4e0d\u662f\u5c0f\u513f\u79d1\uff0c\u800c\u4e14\u6211\u89c9\u5f97 <\/p>\n<p>https:\/\/chromedevtools.github.io\/devtools-protocol\/<\/p>\n<p>\u5b98\u65b9\u6587\u6863\u5199\u7684\u633a\u8be6\u7ec6\u4e86\uff0c\u4f60\u662f\u4e0d\u662f\u6ca1\u6709\u627e\u5bf9\u5730\u65b9\uff1f\u5176\u5b9e\u4e24\u5e74\u524d\u6211\u5c31\u5df2\u7ecf\u628a devtools-protocol \u5b9e\u73b0\u4e86<\/p>\n<p>https:\/\/github.com\/supermoonie\/AutoChrome<\/p>\n<p>\u53ea\u4e0d\u8fc7\u6211\u89c9\u5f97\u6709\u4e9b\u5730\u65b9\u505a\u7684\u4e0d\u591f\u597d\uff0c\u5c31\u6401\u7f6e\u4e86\uff0c\u6700\u8fd1 Netty \uff08 Java \u5f02\u6b65 IO \u5e93\uff09\u5b66\u5f97\u5dee\u4e0d\u591a\u4e86\uff0c\u5c31\u60f3\u518d\u7528\u5f02\u6b65 IO \u5b9e\u73b0\u4e0b\u3002<\/p>\n<p>\u5176\u5b9e go \u8fd9\u65b9\u9762\u505a\u7684\u633a\u597d\u7684\uff0c\u53ea\u662f\u5b9e\u5728\u4e2a\u4eba\u7cbe\u529b\u6709\u9650\uff08\u4e2a\u4eba\u9879\u76ee\u5728\u5f00\u53d1\u4e2d\u3002\u3002\u3002\uff09\uff0c\u8981\u4e0d\u7136\u6211\u4e5f\u53bb\u641e\u641e go \u4e86\uff0c\u539f\u672c\u6211\u8fd8\u60f3\u7528 Qt \u53bb\u5199\u4e00\u4e2a QAutoChrome \u4ee5\u53ca Python \u5199 PyAutoChrome<\/p>\n<p>https:\/\/github.com\/supermoonie\/PyAutoChrome<br \/>https:\/\/github.com\/supermoonie\/QAutoChrome<\/p>\n<p>\u53ea\u4e0d\u8fc7\u6ca1\u65f6\u95f4\u7f62\u4e86\uff0c\u54c8\u54c8                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3411546\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : ysmood <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @supermoonie \u5c31\u662f\u4e2a\u7ecf\u5178\u751f\u4ea7\u6d88\u8d39\u6a21\u578b\u800c\u5df2\uff0c\u4e86\u89e3\u4e86\u539f\u7406\uff0c\u8ba9\u6211\u7528 java \u5199\u6211\u4e5f\u89c9\u5f97\u633a\u7b80\u5355\u7684\uff0c\u5c31\u7b97\u4e0d\u7528 netty \u4e5f\u53ef\u4ee5\u7684\uff0c\u74f6\u9888\u4e0d\u5728\u8fd9\u513f\u3002\u6211\u89c9\u5f97\u6ca1\u5fc5\u8981\u4e89\u8bba\u8fd9\u4e2a\uff0c\u4e2a\u4eba\u4e3b\u89c2\u611f\u53d7\u800c\u5df2\uff0c\u4ec1\u8005\u89c1\u4ec1\u667a\u8005\u89c1\u667a\u3002<\/p>\n<p>https:\/\/chromedevtools.github.io\/devtools-protocol\/ \u8fd9\u4e2a\u6211\u662f\u77e5\u9053\u7684\uff0crod \u6587\u6863\u91cc\u4e5f\u591a\u6b21\u63d0\u5230\u4e86\u8fd9\u4e2a\uff0c\u800c\u4e14 rod \u672c\u8eab\u5f88\u591a\u4ee3\u7801\u4e5f\u662f\u81ea\u52a8\u751f\u6210\u4e8e\u8fd9\u4e2a\u7684\u3002<\/p>\n<p>\u6211\u8ba4\u8bc6\u7684\u6df1\u5165\u5f00\u53d1\u8fc7 cdp \u7684\u4eba\u90fd\u89c9\u5f97 https:\/\/chromedevtools.github.io\/devtools-protocol\/ \u5199\u7684\u4e0d\u591f\u8be6\u7ec6\uff0c\u6bd4\u5982 Page.createIsolatedWorld \u7684\u6587\u6863\uff0c\u6211\u662f\u770b\u4e0d\u61c2\u7684\uff0c\u6bd4\u5982 IsolatedWorld \u548c v8 \u7684\u5173\u7cfb\uff0c\u751f\u547d\u5468\u671f\uff0c\u4f5c\u7528\u8303\u56f4\u5565\u90fd\u6ca1\u8bf4\u3002\u4e00\u5806\u7c7b\u4f3c\u7684\u4e0d\u660e\u4e0d\u767d\u7684 API \u8bf4\u660e\u3002                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3411547\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : supermoonie <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @ysmood \u54c8\u54c8\u54c8\uff0c\u8fd9\u5012\u662f\uff0c\u4e0d\u8fc7\u8fd9\u4e9b api \u65e0\u5173\u7d27\u8981\u3002\u7a81\u7136\u60f3\u8d77\u6765\u4e0d\u6253\u7b97\u641e cdp \u7684\u4e00\u4e2a\u91cd\u8981\u539f\u56e0\uff0ccef \u2026\u2026 \u524d\u6bb5\u65f6\u95f4\u5df2\u7ecf\u6253\u901a\u4e86 cef \u7684 java \u7ed1\u5b9a\uff0c\u5404\u79cd api \u968f\u4fbf\u8c03\u7528\uff0c\u8fd8\u5b9e\u73b0\u4e86\u4e00\u4e2a\u7b80\u5355\u7684\u6d4f\u89c8\u5668\uff0c\u7136\u540e\u5c31\u89c9\u5f97 cdp \u4e0d\u9999\u4e86                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3411548\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : supermoonie <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @ysmood \u66f4\u6b63\u4e0b\uff0c\u53ef\u80fd\u662f\u6211\u8868\u8fbe\u4e0d\u51c6\u786e\uff0c\u6ca1\u6709\u60f3\u8868\u8fbe\u54ea\u79cd\u8bed\u8a00\u597d\u4e0e\u574f\uff0c\u6211\u7684\u9505                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3411549\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : ysmood <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @supermoonie cef \u8ddf cdp \u8981\u89e3\u51b3\u7684\u95ee\u9898\u5b8c\u5168\u4e0d\u540c\u3002\u800c\u4e14\u6211\u8981\u7528 cef \u7684\u8bdd\uff0c\u8fd8\u7528\u4e2a\u6bdb\u7684 java\uff0c\u76f4\u63a5 c++ \u4e86\uff0c\u4f55\u5fc5\u6298\u817e\u81ea\u5df1\u5462\u3002\u5b66\u4e2a\u8bed\u8a00\u7684\u6210\u672c\u6bd4\u8de8\u8bed\u8a00 embed \u5751\u8981\u5c11\u591a\u4e86\u3002<\/p>\n<p>\u6bd4\u5982\u6211\u53ef\u4ee5\u7acb\u523b\u7528\u540c\u65f6\u7528 puppeteer \u548c rod \u63a7\u5236\u51e0\u5343\u4e2a chromium \u7684\u96c6\u7fa4\uff0c\u4f60\u7528 cef \u4e0d\u53c8\u662f\u8981\u81ea\u5df1\u6765\u4e00\u5957 cdp \u7684\u8f6e\u5b50\u624d\u80fd\u505a\u5230\u8fd9\u79cd\u7ea7\u522b\u7684\u89e3\u8026\u5417\uff1f                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3411550\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : iiusky <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u622a\u56fe\u597d\u50cf\u8fd8\u662f\u6709\u95ee\u9898 \u76ee\u524d\u7528\u7684 pjs \u4ee3\u66ff                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3411551\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : pucipuci <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u53ef\u4ee5                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3411552\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : ysmood <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @iiusky \u622a\u56fe\u90fd\u662f\u6211\u5b9e\u9645\u8dd1\u8fc7\u7ed3\u679c\u7684\uff0c\u5e95\u4e0b\u7684\u94fe\u63a5\u4f60\u53ef\u4ee5\u8bbf\u95ee\u7136\u540e\u81ea\u5df1\u8dd1\u3002\u80fd\u8bf4\u4e0b pjs \u662f\u4ec0\u4e48\u610f\u601d\u5417\uff1f\u6ca1\u770b\u61c2                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3411553\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : ysmood <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @iiusky \u94fe\u63a5\u5206\u522b\u662f\uff1a<\/p>\n<p>https:\/\/github.com\/go-rod\/rod\/blob\/master\/lib\/examples\/compare-chromedp\/logic\/main.go<\/p>\n<p>https:\/\/gist.github.com\/ysmood\/12e08d716817b2afa681ba3b9faf97c9 <button onclick=\"lazyGist(this)\">\u00a0\u663e\u793a Gist \u4ee3\u7801\u00a0<\/button> <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3411554\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : lxilu <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             #21 \u64cd\u4f5c\u7cfb\u7edf\u539f\u7406\u8f6f\u4e2d\u65ad                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u5206\u4eab\u4e00\u4e2a\u7528\u4e8e\u81ea\u52a8\u5316\u548c\u722c\u866b\u7684\u5e93 \u8cc7\u6df1&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/158957"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=158957"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/158957\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=158957"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=158957"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=158957"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}