{"id":99683,"date":"2026-09-03T00:37:13","date_gmt":"2026-09-02T16:37:13","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/99683.html"},"modified":"2026-09-03T00:37:13","modified_gmt":"2026-09-02T16:37:13","slug":"%e4%bb%8e%e5%bd%92%e6%a1%a3%e9%a1%b9%e7%9b%aeopenclawbrain-archive%e8%a7%a3%e6%9e%90%e6%95%b0%e6%8d%ae%e9%87%87%e9%9b%86%e4%b8%8e%e6%99%ba%e8%83%bd%e5%a4%84%e7%90%86%e7%b3%bb%e7%bb%9f%e6%9e%b6","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/99683.html","title":{"rendered":"\u4ece\u5f52\u6863\u9879\u76eeopenclawbrain-archive\u89e3\u6790\u6570\u636e\u91c7\u96c6\u4e0e\u667a\u80fd\u5904\u7406\u7cfb\u7edf\u67b6\u6784"},"content":{"rendered":"<h3>\n 1. \u9879\u76ee\u6982\u8ff0\u4e0e\u6838\u5fc3\u4ef7\u503c<br \/>\n<\/h3>\n<p>\n \u6700\u8fd1\u5728\u6574\u7406\u4e00\u4e9b\u65e7\u9879\u76ee\u8d44\u6599\u65f6&#xff0c;\u6211\u91cd\u65b0\u5ba1\u89c6\u4e86\u4e00\u4e2a\u540d\u4e3a\u201copenclawbrain-archive\u201d\u7684\u4ed3\u5e93\u3002\u8fd9\u4e2a\u9879\u76ee\u540d\u542c\u8d77\u6765\u6709\u70b9\u610f\u601d&#xff0c;\u7ed3\u5408\u4e86\u201copen\u201d&#xff08;\u5f00\u653e&#xff09;\u3001\u201cclaw\u201d&#xff08;\u722a\u5b50\/\u6293\u53d6&#xff09;\u548c\u201cbrain\u201d&#xff08;\u5927\u8111\/\u667a\u80fd&#xff09;&#xff0c;\u76f4\u8bd1\u8fc7\u6765\u5927\u6982\u662f\u201c\u5f00\u653e\u722a\u8111\u5b58\u6863\u201d\u3002\u4e4d\u4e00\u770b&#xff0c;\u4f60\u53ef\u80fd\u4f1a\u8054\u60f3\u5230\u67d0\u79cd\u673a\u5668\u4eba\u63a7\u5236\u6216\u6570\u636e\u6293\u53d6\u76f8\u5173\u7684\u667a\u80fd\u7cfb\u7edf\u3002\u5b9e\u9645\u4e0a&#xff0c;\u8fd9\u4e2a\u4ed3\u5e93\u662f\u4e00\u4e2a\u5178\u578b\u7684\u201c\u5f52\u6863\u201d&#xff08;Archive&#xff09;\u9879\u76ee&#xff0c;\u5b83\u4ee3\u8868\u7740\u4e00\u4e2a\u66fe\u7ecf\u6d3b\u8dc3\u3001\u4f46\u73b0\u5728\u53ef\u80fd\u5df2\u505c\u6b62\u4e3b\u8981\u5f00\u53d1\u6216\u8fdb\u5165\u7ef4\u62a4\u72b6\u6001\u7684\u8f6f\u4ef6\u6216\u7814\u7a76\u9879\u76ee\u7684\u4ee3\u7801\u3001\u6587\u6863\u548c\u8d44\u4ea7\u7684\u96c6\u5408\u3002\n<\/p>\n<p>\n \u5bf9\u4e8e\u5f00\u53d1\u8005\u3001\u7814\u7a76\u8005\u751a\u81f3\u662f\u6280\u672f\u7231\u597d\u8005\u800c\u8a00&#xff0c;\u8fd9\u7c7b\u5f52\u6863\u9879\u76ee\u5c31\u50cf\u4e00\u5ea7\u5ea7\u88ab\u65f6\u95f4\u5c01\u5b58\u7684\u201c\u6570\u5b57\u56fe\u4e66\u9986\u201d\u3002\u5b83\u4eec\u53ef\u80fd\u4e0d\u518d\u6709\u6700\u65b0\u7684\u63d0\u4ea4&#xff0c;\u4f46\u5176\u8574\u542b\u7684\u8bbe\u8ba1\u601d\u8def\u3001\u89e3\u51b3\u7279\u5b9a\u95ee\u9898\u7684\u67b6\u6784\u65b9\u6848&#xff0c;\u751a\u81f3\u662f\u90a3\u4e9b\u201c\u672a\u5b8c\u6210\u201d\u7684\u5c1d\u8bd5&#xff0c;\u90fd\u5177\u6709\u6781\u9ad8\u7684\u53c2\u8003\u4ef7\u503c\u3002\u8fd9\u4e2a\u201copenclawbrain-archive\u201d\u9879\u76ee&#xff0c;\u4ece\u5176\u547d\u540d\u63a8\u6d4b&#xff0c;\u5f88\u53ef\u80fd\u6d89\u53ca\u4e00\u4e2a\u4e0e\u81ea\u52a8\u5316\u6293\u53d6&#xff08;Claw&#xff09;\u548c\u667a\u80fd\u5904\u7406&#xff08;Brain&#xff09;\u76f8\u5173\u7684\u5f00\u6e90\u7cfb\u7edf\u3002\u6df1\u5165\u6316\u6398\u8fd9\u7c7b\u9879\u76ee&#xff0c;\u4e0d\u4ec5\u80fd\u5e2e\u52a9\u6211\u4eec\u7406\u89e3\u7279\u5b9a\u6280\u672f\u9886\u57df\u7684\u5386\u53f2\u6f14\u8fdb&#xff0c;\u66f4\u80fd\u4ece\u4e2d\u6c72\u53d6\u7075\u611f&#xff0c;\u907f\u514d\u91cd\u590d\u9020\u8f6e\u5b50&#xff0c;\u751a\u81f3\u662f\u5728\u524d\u4eba\u7684\u80a9\u8180\u4e0a\u53d1\u73b0\u65b0\u7684\u521b\u65b0\u70b9\u3002\u65e0\u8bba\u4f60\u662f\u60f3\u590d\u73b0\u67d0\u4e2a\u7ecf\u5178\u7b97\u6cd5&#xff0c;\u5b66\u4e60\u7279\u5b9a\u67b6\u6784&#xff0c;\u8fd8\u662f\u4e3a\u81ea\u5df1\u7684\u9879\u76ee\u5bfb\u627e\u53ef\u501f\u9274\u7684\u6a21\u5757&#xff0c;\u8fd9\u7c7b\u5f52\u6863\u4ed3\u5e93\u90fd\u662f\u4e00\u4e2a\u5b9d\u5e93\u3002\n<\/p>\n<h3>\n 2. \u9879\u76ee\u80cc\u666f\u4e0e\u9886\u57df\u5b9a\u4f4d<br \/>\n<\/h3>\n<p>\n \u8981\u771f\u6b63\u7406\u89e3\u201copenclawbrain-archive\u201d&#xff0c;\u6211\u4eec\u9700\u8981\u5148\u62c6\u89e3\u5176\u540d\u79f0\u80cc\u540e\u7684\u6f5c\u5728\u9886\u57df\u3002\u5c06\u201cClaw\u201d\u548c\u201cBrain\u201d\u7ec4\u5408&#xff0c;\u5728\u6280\u672f\u8bed\u5883\u4e0b&#xff0c;\u4e00\u4e2a\u975e\u5e38\u5408\u7406\u7684\u8054\u60f3\u662f<\/p>\n<p>  \u201c\u7f51\u7edc\u722c\u866b\u201d<\/p>\n<p> \u6216\u66f4\u5e7f\u4e49\u7684<\/p>\n<p>  \u201c\u6570\u636e\u91c7\u96c6\u4e0e\u667a\u80fd\u5904\u7406\u7ba1\u9053\u201d<\/p>\n<p> \u3002\n<\/p>\n<ul>\n<li>\n<p>   Claw&#xff08;\u722a&#xff09;<\/p>\n<p>  &#xff1a;\u8c61\u5f81\u7740\u6293\u53d6\u3001\u91c7\u96c6\u7684\u52a8\u4f5c\u3002\u5728\u8f6f\u4ef6\u9886\u57df&#xff0c;\u8fd9\u901a\u5e38\u6307\u5411\u4ece\u4e92\u8054\u7f51\u6216\u7279\u5b9a\u6570\u636e\u6e90\u81ea\u52a8\u83b7\u53d6\u4fe1\u606f\u7684\u7a0b\u5e8f&#xff0c;\u5373\u722c\u866b&#xff08;Crawler&#xff09;\u6216\u91c7\u96c6\u5668&#xff08;Scraper&#xff09;\u3002\u5b83\u8d1f\u8d23\u201c\u4f38\u51fa\u624b\u201d&#xff0c;\u89e6\u53ca\u76ee\u6807\u6570\u636e\u6e90&#xff0c;\u5e76\u5c06\u539f\u59cb\u6570\u636e\u201c\u6293\u53d6\u201d\u56de\u6765\u3002\n <\/li>\n<li>\n<p>   Brain&#xff08;\u8111&#xff09;<\/p>\n<p>  &#xff1a;\u8c61\u5f81\u7740\u5206\u6790\u3001\u7406\u89e3\u3001\u51b3\u7b56\u7684\u667a\u80fd\u90e8\u5206\u3002\u539f\u59cb\u6570\u636e&#xff08;\u5982HTML\u3001JSON\u3001\u7eaf\u6587\u672c&#xff09;\u672c\u8eab\u4ef7\u503c\u6709\u9650&#xff0c;\u201cBrain\u201d\u8d1f\u8d23\u5bf9\u8fd9\u4e9b\u6570\u636e\u8fdb\u884c\u6e05\u6d17\u3001\u89e3\u6790\u3001\u7ed3\u6784\u5316&#xff0c;\u63d0\u53d6\u5173\u952e\u4fe1\u606f&#xff0c;\u751a\u81f3\u8fdb\u884c\u521d\u6b65\u7684\u5206\u6790\u3001\u5206\u7c7b\u6216\u9884\u6d4b\u3002\n <\/li>\n<li>\n<p>   Open&#xff08;\u5f00\u653e&#xff09;<\/p>\n<p>  &#xff1a;\u8868\u660e\u8fd9\u662f\u4e00\u4e2a\u5f00\u6e90\u9879\u76ee&#xff0c;\u5176\u4ee3\u7801\u3001\u8bbe\u8ba1\u7406\u5ff5\u662f\u516c\u5f00\u3001\u53ef\u88ab\u5ba1\u67e5\u548c\u590d\u7528\u7684\u3002\n <\/li>\n<li>\n<p>   Archive&#xff08;\u5b58\u6863&#xff09;<\/p>\n<p>  &#xff1a;\u8868\u660e\u9879\u76ee\u72b6\u6001\u5df2\u5f52\u6863\u3002\u8fd9\u5e76\u4e0d\u610f\u5473\u7740\u9879\u76ee\u65e0\u7528\u6216\u9519\u8bef&#xff0c;\u800c\u662f\u5176\u5f00\u53d1\u8fdb\u5165\u4e86\u4e00\u4e2a\u7a33\u5b9a\u3001\u51bb\u7ed3\u6216\u7ef4\u62a4\u6a21\u5f0f&#xff0c;\u6216\u8005\u9879\u76ee\u76ee\u6807\u5df2\u5b8c\u6210&#xff0c;\u4ee3\u7801\u4f5c\u4e3a\u6210\u679c\u88ab\u4fdd\u5b58\u4e0b\u6765\u4f9b\u540e\u4eba\u53c2\u8003\u3002\n <\/li>\n<\/ul>\n<p>\n \u56e0\u6b64&#xff0c;\u8fd9\u4e2a\u9879\u76ee\u6781\u6709\u53ef\u80fd\u662f\u4e00\u4e2a<\/p>\n<p>  \u5f00\u6e90\u7684\u6570\u636e\u91c7\u96c6\u4e0e\u5904\u7406\u6846\u67b6\u6216\u5de5\u5177\u96c6\u7684\u5f52\u6863\u7248\u672c<\/p>\n<p> \u3002\u5b83\u53ef\u80fd\u63d0\u4f9b\u4e86\u4e00\u5957\u5b8c\u6574\u7684\u89e3\u51b3\u65b9\u6848&#xff0c;\u6db5\u76d6\u4e86\u4ece\u76ee\u6807\u53d1\u73b0\u3001\u8bf7\u6c42\u8c03\u5ea6\u3001\u53cd\u722c\u5e94\u5bf9&#xff08;Claw\u90e8\u5206&#xff09;&#xff0c;\u5230\u6570\u636e\u89e3\u6790\u3001\u5185\u5bb9\u62bd\u53d6\u3001\u8d28\u91cf\u8bc4\u4f30\u4e43\u81f3\u7b80\u5355\u7684\u673a\u5668\u5b66\u4e60\u96c6\u6210&#xff08;Brain\u90e8\u5206&#xff09;\u3002\u8fd9\u7c7b\u7cfb\u7edf\u5728\u5b66\u672f\u7814\u7a76&#xff08;\u5982\u6784\u5efa\u7279\u5b9a\u9886\u57df\u8bed\u6599\u5e93&#xff09;\u3001\u5546\u4e1a\u60c5\u62a5\u5206\u6790\u3001\u4ef7\u683c\u76d1\u63a7\u3001\u8206\u60c5\u5206\u6790\u7b49\u9886\u57df\u6709\u7740\u5e7f\u6cdb\u7684\u5e94\u7528\u3002\n<\/p>\n<h3>\n 3. \u6838\u5fc3\u67b6\u6784\u4e0e\u8bbe\u8ba1\u601d\u8def\u89e3\u6790<br \/>\n<\/h3>\n<p>\n \u5c3d\u7ba1\u6211\u4eec\u65e0\u6cd5\u76f4\u63a5\u8fd0\u884c\u4e00\u4e2a\u5f52\u6863\u4ed3\u5e93\u7684\u6700\u65b0\u4ee3\u7801&#xff0c;\u4f46\u901a\u8fc7\u5206\u6790\u5176\u6587\u4ef6\u7ed3\u6784\u3001\u6587\u6863&#xff08;\u5982README&#xff09;\u3001\u4e3b\u8981\u7684\u6e90\u4ee3\u7801\u6587\u4ef6\u548c\u9057\u7559\u7684\u914d\u7f6e\u6587\u4ef6&#xff0c;\u6211\u4eec\u53ef\u4ee5\u9006\u5411\u63a8\u5bfc\u51fa\u5b83\u7684\u6838\u5fc3\u67b6\u6784\u8bbe\u8ba1\u3002\u4e00\u4e2a\u5178\u578b\u7684\u201cClaw &#043; Brain\u201d\u7cfb\u7edf\u901a\u5e38\u4f1a\u91c7\u7528\u6a21\u5757\u5316\u3001\u7ba1\u9053\u5316&#xff08;Pipeline&#xff09;\u7684\u8bbe\u8ba1\u601d\u60f3\u3002\n<\/p>\n<h4>\n 3.1 \u5206\u5c42\u4e0e\u6a21\u5757\u5316\u8bbe\u8ba1<br \/>\n<\/h4>\n<p>\n \u4e00\u4e2a\u5065\u58ee\u7684\u6570\u636e\u667a\u80fd\u91c7\u96c6\u7cfb\u7edf\u4e0d\u4f1a\u5c06\u6240\u6709\u903b\u8f91\u7cc5\u6742\u5728\u4e00\u8d77\u3002\u901a\u8fc7\u5206\u6790\u4ed3\u5e93\u76ee\u5f55&#xff0c;\u6211\u4eec\u901a\u5e38\u80fd\u53d1\u73b0\u7c7b\u4f3c\u5982\u4e0b\u7684\u6a21\u5757\u5212\u5206&#xff1a;\n<\/p>\n<li>\n<p>    \u8c03\u5ea6\u5668\u4e0e\u4efb\u52a1\u7ba1\u7406\u6a21\u5757<\/p>\n<p>   &#xff1a;\u8fd9\u662f\u7cfb\u7edf\u7684\u5927\u8111\u76ae\u5c42&#xff0c;\u8d1f\u8d23\u9ad8\u7ea7\u534f\u8c03\u3002\u5b83\u53ef\u80fd\u5305\u542b\u4e00\u4e2a\u4efb\u52a1\u961f\u5217&#xff08;\u57fa\u4e8eRedis\u3001RabbitMQ\u6216\u5185\u5b58\u961f\u5217&#xff09;&#xff0c;\u7528\u4e8e\u7ba1\u7406\u5f85\u6293\u53d6\u7684URL\u5217\u8868&#xff08;\u79cd\u5b50&#xff09;&#xff0c;\u5e76\u8c03\u5ea6\u201cClaw\u201d\u6a21\u5757\u53bb\u6267\u884c\u3002\u5b83\u9700\u8981\u5904\u7406\u4f18\u5148\u7ea7\u3001\u53bb\u91cd\u3001\u901f\u7387\u63a7\u5236\u7b49\u7b56\u7565\u3002\n  <\/p>\n<ul>\n<li>\n<p>     \u8bbe\u8ba1\u8003\u91cf<\/p>\n<p>    &#xff1a;\u4e3a\u4ec0\u4e48\u9009\u62e9\u7279\u5b9a\u7684\u961f\u5217\u670d\u52a1&#xff1f;\u53ef\u80fd\u662f\u51fa\u4e8e\u6301\u4e45\u5316\u3001\u5206\u5e03\u5f0f\u6269\u5c55\u7684\u9700\u6c42\u3002\u4efb\u52a1\u63cf\u8ff0\u7684\u7ed3\u6784&#xff08;\u53ef\u80fd\u662f\u4e00\u4e2a\u5305\u542bURL\u3001\u4f18\u5148\u7ea7\u3001\u5143\u6570\u636e\u7684JSON\u5bf9\u8c61&#xff09;\u4e5f\u4f53\u73b0\u4e86\u7cfb\u7edf\u7684\u7075\u6d3b\u6027\u3002\n   <\/li>\n<\/ul>\n<\/li>\n<li>\n<p>    \u722c\u866b\u5f15\u64ce\u6838\u5fc3\u6a21\u5757<\/p>\n<p>   &#xff1a;\u8fd9\u662f\u201cClaw\u201d\u7684\u5177\u4f53\u5b9e\u73b0\u3002\u5b83\u8d1f\u8d23\u53d1\u9001HTTP\/HTTPS\u8bf7\u6c42&#xff0c;\u4e0b\u8f7d\u7f51\u9875\u6216API\u54cd\u5e94\u3002\u4e00\u4e2a\u6210\u719f\u7684\u5f15\u64ce\u4f1a\u5305\u542b&#xff1a;\n  <\/p>\n<ul>\n<li>\n<p>     \u8bf7\u6c42\u4f1a\u8bdd\u7ba1\u7406<\/p>\n<p>    &#xff1a;\u7ef4\u62a4Cookie\u3001Session&#xff0c;\u6a21\u62df\u6d4f\u89c8\u5668\u884c\u4e3a\u3002\n   <\/li>\n<li>\n<p>     \u4ee3\u7406\u4e0eIP\u8f6e\u6362\u6c60<\/p>\n<p>    &#xff1a;\u5e94\u5bf9\u53cd\u722c\u866b\u673a\u5236\u7684\u5173\u952e\u3002\u4ee3\u7801\u4e2d\u53ef\u80fd\u4f1a\u6709\u4e00\u4e2a\u4ee3\u7406\u7ba1\u7406\u5668&#xff0c;\u8d1f\u8d23\u4ece\u591a\u4e2a\u4ee3\u7406\u6e90\u83b7\u53d6IP&#xff0c;\u5e76\u5728\u8bf7\u6c42\u5931\u8d25\u65f6\u81ea\u52a8\u5207\u6362\u3002\n   <\/li>\n<li>\n<p>     \u5f02\u6b65\u5e76\u53d1\u5904\u7406<\/p>\n<p>    &#xff1a;\u4e3a\u4e86\u63d0\u9ad8\u6548\u7387&#xff0c;\u5fc5\u7136\u4f1a\u4f7f\u7528\u5f02\u6b65IO&#xff08;\u5982Python\u7684<\/p>\n<p>     asyncio<\/p>\n<p>    &#043;<\/p>\n<p>     aiohttp<\/p>\n<p>    &#xff09;\u6216\u591a\u7ebf\u7a0b\/\u8fdb\u7a0b\u3002\u76f8\u5173\u914d\u7f6e\u53c2\u6570&#xff08;\u5e76\u53d1\u6570\u3001\u5ef6\u8fdf\u65f6\u95f4&#xff09;\u662f\u6027\u80fd\u8c03\u4f18\u7684\u5173\u952e\u3002\n   <\/li>\n<li>\n<p>     \u9519\u8bef\u5904\u7406\u4e0e\u91cd\u8bd5\u673a\u5236<\/p>\n<p>    &#xff1a;\u7f51\u7edc\u8bf7\u6c42\u5145\u6ee1\u4e0d\u786e\u5b9a\u6027\u3002\u5065\u58ee\u7684\u4ee3\u7801\u4f1a\u6709\u5b8c\u5584\u7684\u5f02\u5e38\u6355\u83b7\u3001\u72b6\u6001\u7801\u68c0\u67e5\u4ee5\u53ca\u53ef\u914d\u7f6e\u7684\u91cd\u8bd5\u903b\u8f91&#xff08;\u5982\u6307\u6570\u9000\u907f&#xff09;\u3002\n   <\/li>\n<\/ul>\n<\/li>\n<li>\n<p>    \u4e2d\u95f4\u4ef6\u4e0e\u5904\u7406\u5668\u7ba1\u9053<\/p>\n<p>   &#xff1a;\u5728\u539f\u59cb\u54cd\u5e94\u5230\u8fbe\u201cBrain\u201d\u4e4b\u524d&#xff0c;\u901a\u5e38\u9700\u8981\u7ecf\u8fc7\u4e00\u7cfb\u5217\u9884\u5904\u7406\u3002\u8fd9\u53ef\u80fd\u5305\u62ec&#xff1a;\n  <\/p>\n<ul>\n<li>\n<p>     \u5185\u5bb9\u89e3\u7801\u4e0e\u89e3\u538b<\/p>\n<p>    &#xff1a;\u5904\u7406Gzip\u3001Deflate\u7b49\u538b\u7f29\u683c\u5f0f\u3002\n   <\/li>\n<li>\n<p>     \u57fa\u7840\u6e05\u6d17<\/p>\n<p>    &#xff1a;\u53bb\u9664\u65e0\u5173\u7684\u811a\u672c\u3001\u6837\u5f0f\u6807\u7b7e\u3002\n   <\/li>\n<li>\n<p>     \u53cd\u722c\u866b\u7ed5\u8fc7<\/p>\n<p>    &#xff1a;\u6267\u884cJavaScript&#xff08;\u901a\u8fc7\u96c6\u6210\u65e0\u5934\u6d4f\u89c8\u5668\u5982Playwright\u6216Selenium&#xff09;\u3001\u8bc6\u522b\u9a8c\u8bc1\u7801&#xff08;\u53ef\u80fd\u96c6\u6210\u6253\u7801\u5e73\u53f0\u63a5\u53e3&#xff09;\u7b49\u3002\u8fd9\u90e8\u5206\u4ee3\u7801\u662f\u5b9e\u6218\u7ecf\u9a8c\u7684\u96c6\u4e2d\u4f53\u73b0\u3002\n   <\/li>\n<\/ul>\n<\/li>\n<li>\n<p>    \u6570\u636e\u89e3\u6790\u4e0e\u62bd\u53d6\u6a21\u5757<\/p>\n<p>   &#xff1a;\u8fd9\u662f\u201cBrain\u201d\u7684\u524d\u7aef\u3002\u5b83\u4ece\u7ed3\u6784\u5316\u548c\u975e\u7ed3\u6784\u5316\u6570\u636e\u4e2d\u63d0\u53d6\u76ee\u6807\u4fe1\u606f\u3002\u65b9\u6cd5\u53ef\u80fd\u5305\u62ec&#xff1a;\n  <\/p>\n<ul>\n<li>\n<p>     \u89c4\u5219\u5339\u914d<\/p>\n<p>    &#xff1a;\u4f7f\u7528XPath\u3001CSS\u9009\u62e9\u5668\u3001\u6b63\u5219\u8868\u8fbe\u5f0f\u3002\u4ee3\u7801\u4e2d\u53ef\u80fd\u4f1a\u5b9a\u4e49\u5927\u91cf\u7684\u201c\u62bd\u53d6\u89c4\u5219\u914d\u7f6e\u6587\u4ef6\u201d&#xff0c;\u5c06\u89c4\u5219\u4e0eURL\u6a21\u5f0f\u5173\u8054\u3002\n   <\/li>\n<li>\n<p>     \u667a\u80fd\u89e3\u6790<\/p>\n<p>    &#xff1a;\u5982\u679c\u9879\u76ee\u8f83\u65b0&#xff0c;\u53ef\u80fd\u5c1d\u8bd5\u96c6\u6210\u673a\u5668\u5b66\u4e60\u6a21\u578b&#xff0c;\u7528\u4e8e\u81ea\u52a8\u8bc6\u522b\u5217\u8868\u9875\u3001\u8be6\u60c5\u9875\u7684\u4e3b\u4f53\u5185\u5bb9\u3001\u6807\u9898\u3001\u53d1\u5e03\u65f6\u95f4\u7b49&#xff0c;\u51cf\u5c11\u89c4\u5219\u7ef4\u62a4\u6210\u672c\u3002\u76f8\u5173\u4ee3\u7801\u4f1a\u6d89\u53ca\u6a21\u578b\u52a0\u8f7d\u548c\u63a8\u7406\u3002\n   <\/li>\n<\/ul>\n<\/li>\n<li>\n<p>    \u6570\u636e\u5b58\u50a8\u4e0e\u540e\u5904\u7406\u6a21\u5757<\/p>\n<p>   &#xff1a;\u8fd9\u662f\u201cBrain\u201d\u7684\u540e\u7aef\u3002\u63d0\u53d6\u540e\u7684\u7ed3\u6784\u5316\u6570\u636e\u9700\u8981\u88ab\u6301\u4e45\u5316\u3002\u7cfb\u7edf\u53ef\u80fd\u652f\u6301\u591a\u79cd\u8f93\u51fa&#xff1a;\n  <\/p>\n<ul>\n<li>\n<p>     \u6570\u636e\u5e93<\/p>\n<p>    &#xff1a;MySQL\u3001PostgreSQL\u7528\u4e8e\u5173\u7cfb\u578b\u6570\u636e&#xff1b;MongoDB\u7528\u4e8e\u6587\u6863\u578b\u6570\u636e\u3002\n   <\/li>\n<li>\n<p>     \u6587\u4ef6<\/p>\n<p>    &#xff1a;JSON Lines\u3001CSV\u3001Parquet\u683c\u5f0f&#xff0c;\u4fbf\u4e8e\u540e\u7eed\u6279\u91cf\u5206\u6790\u3002\n   <\/li>\n<li>\n<p>     \u6d88\u606f\u961f\u5217<\/p>\n<p>    &#xff1a;\u5c06\u6570\u636e\u5b9e\u65f6\u63a8\u9001\u5230Kafka\u7b49&#xff0c;\u4f9b\u4e0b\u6e38\u6d88\u8d39\u3002<br \/>\n\u6b64\u5916&#xff0c;\u8fd8\u53ef\u80fd\u5305\u542b\u6570\u636e\u53bb\u91cd\u3001\u8d28\u91cf\u6821\u9a8c\u3001\u7b80\u5355\u8f6c\u6362&#xff08;\u5982\u65e5\u671f\u683c\u5f0f\u5316&#xff09;\u7b49\u540e\u5904\u7406\u903b\u8f91\u3002\n   <\/li>\n<\/ul>\n<\/li>\n<li>\n<p>    \u914d\u7f6e\u4e0e\u76d1\u63a7\u7cfb\u7edf<\/p>\n<p>   &#xff1a;\u4e00\u4e2a\u7528\u4e8e\u751f\u4ea7\u73af\u5883\u7684\u7cfb\u7edf\u79bb\u4e0d\u5f00\u914d\u7f6e\u5316\u548c\u53ef\u89c2\u6d4b\u6027\u3002\u9879\u76ee\u6839\u76ee\u5f55\u4e0b\u7684<\/p>\n<p>    config.yaml<\/p>\n<p>   \u6216<\/p>\n<p>    .env<\/p>\n<p>   \u6587\u4ef6\u5b9a\u4e49\u4e86\u6240\u6709\u53ef\u8c03\u53c2\u6570\u3002\u540c\u65f6&#xff0c;\u4ee3\u7801\u4e2d\u53ef\u80fd\u96c6\u6210\u4e86\u65e5\u5fd7\u8bb0\u5f55&#xff08;\u7ed3\u6784\u5316\u65e5\u5fd7\u5982JSON\u683c\u5f0f&#xff09;\u548c\u7b80\u5355\u7684\u6307\u6807\u4e0a\u62a5&#xff08;\u5982\u5df2\u6293\u53d6\u6570\u91cf\u3001\u6210\u529f\u7387\u3001\u8017\u65f6&#xff09;&#xff0c;\u65b9\u4fbf\u76d1\u63a7\u7cfb\u7edf\u5065\u5eb7\u5ea6\u3002\n  <\/p>\n<\/li>\n<h4>\n 3.2 \u8bbe\u8ba1\u6a21\u5f0f\u7684\u5e94\u7528<br \/>\n<\/h4>\n<p>\n \u5728\u9605\u8bfb\u6b64\u7c7b\u9879\u76ee\u4ee3\u7801\u65f6&#xff0c;\u4f60\u4f1a\u9891\u7e41\u770b\u5230\u4e00\u4e9b\u7ecf\u5178\u8bbe\u8ba1\u6a21\u5f0f\u7684\u5e94\u7528&#xff1a;\n<\/p>\n<ul>\n<li>\n<p>   \u5de5\u5382\u6a21\u5f0f<\/p>\n<p>  &#xff1a;\u7528\u4e8e\u521b\u5efa\u4e0d\u540c\u7c7b\u578b\u7684\u4e0b\u8f7d\u5668&#xff08;\u5982\u666e\u901aHTTP\u4e0b\u8f7d\u5668\u3001\u65e0\u5934\u6d4f\u89c8\u5668\u4e0b\u8f7d\u5668&#xff09;\u6216\u89e3\u6790\u5668\u3002\n <\/li>\n<li>\n<p>   \u7b56\u7565\u6a21\u5f0f<\/p>\n<p>  &#xff1a;\u4e0d\u540c\u7684\u53cd\u722c\u7b56\u7565&#xff08;\u6362User-Agent\u3001\u7528\u4ee3\u7406\u3001\u52a0\u5ef6\u8fdf&#xff09;\u53ef\u4ee5\u88ab\u52a8\u6001\u7ec4\u5408\u548c\u5207\u6362\u3002\n <\/li>\n<li>\n<p>   \u89c2\u5bdf\u8005\u6a21\u5f0f<\/p>\n<p>  &#xff1a;\u7528\u4e8e\u5b9e\u73b0\u4e8b\u4ef6\u9a71\u52a8&#xff0c;\u4f8b\u5982\u201c\u4e00\u4e2a\u9875\u9762\u4e0b\u8f7d\u5b8c\u6210\u201d\u4e8b\u4ef6\u89e6\u53d1\u591a\u4e2a\u89e3\u6790\u5668\u7684\u5904\u7406\u3002\n <\/li>\n<\/ul>\n<p>   \u6ce8\u610f<\/p>\n<p>  &#xff1a;\u5f52\u6863\u9879\u76ee\u7684\u4e00\u4e2a\u5e38\u89c1\u7279\u70b9\u662f&#xff0c;\u5176\u4f9d\u8d56\u7684\u7b2c\u4e09\u65b9\u5e93\u53ef\u80fd\u5df2\u7ecf\u8fc7\u65f6\u751a\u81f3\u4e0d\u518d\u7ef4\u62a4\u3002\u5728\u590d\u73b0\u6216\u53c2\u8003\u65f6&#xff0c;\u9700\u8981\u7279\u522b\u6ce8\u610f<\/p>\n<p>   requirements.txt<\/p>\n<p>  \u6216<\/p>\n<p>   pyproject.toml<\/p>\n<p>  \u4e2d\u7684\u7248\u672c\u53f7&#xff0c;\u8bc4\u4f30\u5347\u7ea7\u4f9d\u8d56\u7684\u98ce\u9669\u3002\n <\/p>\n<h3>\n 4. \u5173\u952e\u6280\u672f\u4e0e\u5b9e\u73b0\u7ec6\u8282\u5256\u6790<br \/>\n<\/h3>\n<p>\n \u8ba9\u6211\u4eec\u6df1\u5165\u5230\u51e0\u4e2a\u5173\u952e\u6280\u672f\u70b9&#xff0c;\u770b\u770b\u4e00\u4e2a\u771f\u5b9e\u7684\u201copenclawbrain\u201d\u7cfb\u7edf\u53ef\u80fd\u4f1a\u5982\u4f55\u5b9e\u73b0\u3002\n<\/p>\n<h4>\n 4.1 \u9ad8\u6548\u5f02\u6b65\u722c\u866b\u5f15\u64ce\u7684\u5b9e\u73b0<br \/>\n<\/h4>\n<p>\n \u73b0\u4ee3\u722c\u866b\u7684\u6838\u5fc3\u662f\u5e76\u53d1\u6548\u7387\u3002\u5047\u8bbe\u9879\u76ee\u4f7f\u7528Python&#xff0c;\u90a3\u4e48<\/p>\n<p>  asyncio<\/p>\n<p> \u548c<\/p>\n<p>  aiohttp<\/p>\n<p> \u51e0\u4e4e\u662f\u6807\u914d\u3002\u4f46\u5982\u4f55\u7ba1\u7406\u6210\u5343\u4e0a\u4e07\u7684\u5e76\u53d1\u4efb\u52a1\u800c\u4e0d\u88ab\u76ee\u6807\u7f51\u7ad9\u5c01\u6740&#xff0c;\u8fd9\u91cc\u9762\u5927\u6709\u5b66\u95ee\u3002\n<\/p>\n<p># \u793a\u4f8b&#xff1a;\u4e00\u4e2a\u7b80\u5316\u7684\u5f02\u6b65\u722c\u866b\u6838\u5fc3\u5faa\u73af<br \/>\nimport asyncio<br \/>\nimport aiohttp<br \/>\nfrom aiolimiter import AsyncLimiter<\/p>\n<p>class AsyncCrawler:<br \/>\n    def __init__(self, concurrency&#061;10, delay&#061;1.0):<br \/>\n        # \u9650\u5236\u6bcf\u79d2\u8bf7\u6c42\u6570&#xff0c;\u9075\u5b88robots.txt\u548c\u793c\u8c8c\u539f\u5219<br \/>\n        self.rate_limiter &#061; AsyncLimiter(1, 1.0\/delay)<br \/>\n        # \u63a7\u5236\u6700\u5927\u5e76\u53d1\u8fde\u63a5\u6570&#xff0c;\u9632\u6b62\u8017\u5c3d\u8d44\u6e90<br \/>\n        self.semaphore &#061; asyncio.Semaphore(concurrency)<br \/>\n        # \u8bf7\u6c42\u4f1a\u8bdd&#xff0c;\u590d\u7528TCP\u8fde\u63a5<br \/>\n        self.session &#061; None<\/p>\n<p>    async def fetch_page(self, url):<br \/>\n        # \u83b7\u53d6\u4fe1\u53f7\u91cf&#xff0c;\u63a7\u5236\u5e76\u53d1\u91cf<br \/>\n        async with self.semaphore:<br \/>\n            # \u5e94\u7528\u901f\u7387\u9650\u5236<br \/>\n            async with self.rate_limiter:<br \/>\n                if not self.session:<br \/>\n                    # \u521b\u5efa\u5e26\u8d85\u65f6\u548c\u91cd\u8bd5\u7684\u5ba2\u6237\u7aef\u4f1a\u8bdd<br \/>\n                    timeout &#061; aiohttp.ClientTimeout(total&#061;30)<br \/>\n                    connector &#061; aiohttp.TCPConnector(limit&#061;0, ttl_dns_cache&#061;300)<br \/>\n                    self.session &#061; aiohttp.ClientSession(timeout&#061;timeout, connector&#061;connector)<br \/>\n                try:<br \/>\n                    # \u968f\u673aUser-Agent\u548c\u4ee3\u7406\u9700\u4ece\u6c60\u4e2d\u83b7\u53d6<br \/>\n                    headers &#061; {&#039;User-Agent&#039;: self._get_random_ua()}<br \/>\n                    proxy &#061; self.proxy_pool.get_proxy() if self.proxy_pool else None<br \/>\n                    async with self.session.get(url, headers&#061;headers, proxy&#061;proxy) as response:<br \/>\n                        response.raise_for_status()<br \/>\n                        html &#061; await response.text()<br \/>\n                        return html<br \/>\n                except Exception as e:<br \/>\n                    # \u8bb0\u5f55\u9519\u8bef&#xff0c;\u5e76\u6839\u636e\u9519\u8bef\u7c7b\u578b\u51b3\u5b9a\u662f\u5426\u91cd\u8bd5\u3001\u66f4\u6362\u4ee3\u7406<br \/>\n                    self.logger.error(f&#034;Failed to fetch {url}: {e}&#034;)<br \/>\n                    return None<\/p>\n<p>  \u5173\u952e\u70b9\u89e3\u6790<\/p>\n<p> &#xff1a;\n<\/p>\n<ul>\n<li>\n<p>    AsyncLimiter<\/p>\n<p>  &#xff1a;\u8fd9\u662f\u63a7\u5236\u722c\u53d6\u9891\u7387\u7684\u7075\u9b42\u3002\u76f4\u63a5\u8bbe\u7f6e\u4e00\u4e2a\u56fa\u5b9a\u7684<\/p>\n<p>   asyncio.sleep(delay)<\/p>\n<p>  \u5728\u5e76\u53d1\u73af\u5883\u4e0b\u662f\u4e0d\u51c6\u786e\u7684&#xff0c;\u56e0\u4e3a\u4efb\u52a1\u662f\u5e76\u53d1\u7684\u3002<\/p>\n<p>   AsyncLimiter<\/p>\n<p>  \u786e\u4fdd\u4e86\u65e0\u8bba\u5e76\u53d1\u6570\u591a\u5c11&#xff0c;\u5355\u4f4d\u65f6\u95f4\u5185\u7684\u8bf7\u6c42\u6570\u90fd\u4e0d\u4f1a\u8d85\u8fc7\u8bbe\u5b9a\u503c\u3002\n <\/li>\n<li>\n<p>    Semaphore<\/p>\n<p>  &#xff1a;\u9650\u5236\u6700\u5927\u5e76\u53d1\u534f\u7a0b\u6570&#xff0c;\u9632\u6b62\u540c\u65f6\u53d1\u8d77\u8fc7\u591a\u8fde\u63a5&#xff0c;\u8017\u5c3d\u672c\u5730\u7aef\u53e3\u6216\u5bf9\u76ee\u6807\u670d\u52a1\u5668\u9020\u6210\u8fc7\u5927\u538b\u529b\u3002\n <\/li>\n<li>\n<p>   \u4f1a\u8bdd\u590d\u7528<\/p>\n<p>  &#xff1a;\u4f7f\u7528<\/p>\n<p>   aiohttp.ClientSession<\/p>\n<p>  \u590d\u7528TCP\u8fde\u63a5&#xff0c;\u80fd\u663e\u8457\u63d0\u5347\u6027\u80fd\u3002\n <\/li>\n<li>\n<p>   \u9519\u8bef\u5904\u7406\u4e0e\u4ee3\u7406\u96c6\u6210<\/p>\n<p>  &#xff1a;\u7f51\u7edc\u8bf7\u6c42\u5f02\u5e38\u662f\u5e38\u6001\u3002\u5b8c\u5584\u7684\u65e5\u5fd7\u548c\u4ee3\u7406\u5207\u6362\u673a\u5236\u662f\u4fdd\u8bc1\u7cfb\u7edf\u957f\u671f\u7a33\u5b9a\u8fd0\u884c\u7684\u5173\u952e\u3002\u4ee3\u7406\u6c60\u901a\u5e38\u662f\u4e00\u4e2a\u72ec\u7acb\u7684\u7c7b&#xff0c;\u8d1f\u8d23\u68c0\u6d4b\u4ee3\u7406\u6709\u6548\u6027\u3001\u5206\u914d\u548c\u56de\u6536\u4ee3\u7406\u3002\n <\/li>\n<\/ul>\n<h4>\n 4.2 \u53ef\u914d\u7f6e\u7684\u89c4\u5219\u5316\u6570\u636e\u62bd\u53d6<br \/>\n<\/h4>\n<p>\n \u201cBrain\u201d\u7684\u89c4\u5219\u5316\u90e8\u5206&#xff0c;\u5176\u8bbe\u8ba1\u76ee\u6807\u662f\u5c06\u53d8\u5316\u70b9&#xff08;\u9488\u5bf9\u4e0d\u540c\u7f51\u7ad9\u7684\u7ed3\u6784&#xff09;\u914d\u7f6e\u5316&#xff0c;\u800c\u4e0d\u662f\u786c\u7f16\u7801\u5728\u7a0b\u5e8f\u91cc\u3002\n<\/p>\n<p># \u793a\u4f8b&#xff1a;\u89c4\u5219\u914d\u7f6e\u6587\u4ef6 (site_rules.yaml)<br \/>\n&#8211; domain: &#034;example.com&#034;<br \/>\n  rules:<br \/>\n    list_page:<br \/>\n      url_pattern: &#034;https:\/\/example.com\/news\/page\/*&#034;<br \/>\n      item_selector: &#034;div.article-list &gt; article&#034;<br \/>\n      next_page_selector: &#034;a.next-page&#034;<br \/>\n    detail_page:<br \/>\n      fields:<br \/>\n        &#8211; name: &#034;title&#034;<br \/>\n          selector: &#034;h1.article-title&#034;<br \/>\n          type: &#034;text&#034;<br \/>\n          required: true<br \/>\n        &#8211; name: &#034;publish_time&#034;<br \/>\n          selector: &#034;span.time&#034;<br \/>\n          type: &#034;text&#034;<br \/>\n          # \u540e\u5904\u7406\u51fd\u6570&#xff0c;\u5c06\u5b57\u7b26\u4e32\u8f6c\u4e3adatetime\u5bf9\u8c61<br \/>\n          post_process: &#034;parse_datetime&#034;<br \/>\n        &#8211; name: &#034;content&#034;<br \/>\n          selector: &#034;div.article-content&#034;<br \/>\n          type: &#034;html&#034; # \u4fdd\u7559HTML\u683c\u5f0f<br \/>\n          # \u6e05\u7406\u51fd\u6570&#xff0c;\u79fb\u9664\u4e0d\u5fc5\u8981\u7684\u6807\u7b7e<br \/>\n          cleanup: [&#034;script&#034;, &#034;style&#034;, &#034;div.ads&#034;]<\/p>\n<p>\n \u5728\u4ee3\u7801\u4e2d&#xff0c;\u4f1a\u6709\u4e00\u4e2a<\/p>\n<p>  RuleEngine<\/p>\n<p> \u7c7b\u6765\u52a0\u8f7d\u8fd9\u4e9bYAML\u914d\u7f6e&#xff0c;\u5e76\u4f7f\u7528<\/p>\n<p>  lxml<\/p>\n<p> \u6216<\/p>\n<p>  parsel<\/p>\n<p> \u5e93\u6765\u6267\u884c\u9009\u62e9\u5668\u3002\n<\/p>\n<p>import yaml<br \/>\nfrom parsel import Selector<\/p>\n<p>class RuleEngine:<br \/>\n    def __init__(self, rule_file):<br \/>\n        with open(rule_file, &#039;r&#039;) as f:<br \/>\n            self.rules &#061; yaml.safe_load(f)<br \/>\n        # \u5c06\u89c4\u5219\u6309domain\u7f13\u5b58&#xff0c;\u63d0\u9ad8\u5339\u914d\u901f\u5ea6<br \/>\n        self.rule_cache &#061; {rule[&#039;domain&#039;]: rule for rule in self.rules}<\/p>\n<p>    def extract(self, url, html):<br \/>\n        domain &#061; self._extract_domain(url)<br \/>\n        rule &#061; self.rule_cache.get(domain)<br \/>\n        if not rule:<br \/>\n            return None<br \/>\n        sel &#061; Selector(text&#061;html)<br \/>\n        data &#061; {}<br \/>\n        for field in rule[&#039;detail_page&#039;][&#039;fields&#039;]:<br \/>\n            elements &#061; sel.css(field[&#039;selector&#039;])<br \/>\n            if field[&#039;type&#039;] &#061;&#061; &#039;text&#039;:<br \/>\n                value &#061; elements.get(&#039;&#039;).strip()<br \/>\n            elif field[&#039;type&#039;] &#061;&#061; &#039;html&#039;:<br \/>\n                value &#061; elements.get(&#039;&#039;)<br \/>\n            # \u5e94\u7528\u540e\u5904\u7406\u51fd\u6570<br \/>\n            if &#039;post_process&#039; in field:<br \/>\n                value &#061; self._apply_post_process(field[&#039;post_process&#039;], value)<br \/>\n            data[field[&#039;name&#039;]] &#061; value<br \/>\n        return data<\/p>\n<p>  \u8bbe\u8ba1\u4f18\u52bf<\/p>\n<p> &#xff1a;\u8fd9\u79cd\u914d\u7f6e\u9a71\u52a8\u7684\u8bbe\u8ba1&#xff0c;\u4f7f\u5f97\u975e\u5f00\u53d1\u4eba\u5458&#xff08;\u5982\u8fd0\u8425\u6216\u6570\u636e\u5206\u6790\u5e08&#xff09;\u4e5f\u80fd\u901a\u8fc7\u4fee\u6539YAML\u6587\u4ef6\u6765\u5b9a\u4e49\u65b0\u7f51\u7ad9\u7684\u6293\u53d6\u89c4\u5219&#xff0c;\u6781\u5927\u5730\u63d0\u9ad8\u4e86\u7cfb\u7edf\u7684\u53ef\u7ef4\u62a4\u6027\u548c\u6269\u5c55\u6027\u3002\n<\/p>\n<h4>\n 4.3 \u53cd\u53cd\u722c\u866b\u7b56\u7565\u7684\u5b9e\u6218\u96c6\u6210<br \/>\n<\/h4>\n<p>\n \u8fd9\u662f\u722c\u866b\u9879\u76ee\u4e2d\u6700\u5177\u201c\u653b\u9632\u201d\u8272\u5f69\u7684\u90e8\u5206\u3002\u4e00\u4e2a\u5f52\u6863\u9879\u76ee\u4e2d\u7684\u7b56\u7565\u53ef\u80fd\u53cd\u6620\u4e86\u5176\u5f00\u53d1\u65f6\u671f\u7684\u5bf9\u6297\u6c34\u5e73\u3002\n<\/p>\n<li>\n<p>   \u8bf7\u6c42\u5934\u4f2a\u88c5<\/p>\n<p>  &#xff1a;\u4e0d\u4ec5\u4ec5\u662fUser-Agent&#xff0c;\u8fd8\u5305\u62ec<\/p>\n<p>   Accept<\/p>\n<p>  \u3001<\/p>\n<p>   Accept-Language<\/p>\n<p>  \u3001<\/p>\n<p>   Referer<\/p>\n<p>  &#xff0c;\u751a\u81f3<\/p>\n<p>   Sec-CH-UA<\/p>\n<p>  &#xff08;\u5ba2\u6237\u7aef\u63d0\u793a&#xff09;\u7b49&#xff0c;\u9700\u8981\u6a21\u62df\u5f97\u8ddf\u771f\u5b9e\u6d4f\u89c8\u5668\u4e00\u6837\u3002\u4ee3\u7801\u4e2d\u53ef\u80fd\u4f1a\u6709\u4e00\u4e2a\u5e9e\u5927\u7684UA\u5217\u8868\u6587\u4ef6\u3002\n <\/li>\n<li>\n<p>   Cookie\u4e0eSession\u7ba1\u7406<\/p>\n<p>  &#xff1a;\u6709\u4e9b\u7f51\u7ad9\u9700\u8981\u5148\u8bbf\u95ee\u9996\u9875\u83b7\u53d6\u521d\u59cbCookie&#xff0c;\u518d\u643a\u5e26Cookie\u8bbf\u95ee\u6570\u636e\u63a5\u53e3\u3002\u722c\u866b\u5f15\u64ce\u9700\u8981\u80fd\u81ea\u52a8\u7ba1\u7406\u4f1a\u8bdd\u72b6\u6001\u3002\n <\/li>\n<li>\n<p>   IP\u4ee3\u7406\u6c60\u7684\u52a8\u6001\u8c03\u5ea6<\/p>\n<p>  &#xff1a;<\/p>\n<ul>\n<li>\n<p>     \u6765\u6e90<\/p>\n<p>    &#xff1a;\u4ee3\u7801\u53ef\u80fd\u96c6\u6210\u4e86\u514d\u8d39\u4ee3\u7406\u7f51\u7ad9\u7684\u6293\u53d6&#xff0c;\u6216\u5bf9\u63a5\u4e86\u4ed8\u8d39\u4ee3\u7406API\u3002\n   <\/li>\n<li>\n<p>     \u8d28\u91cf\u68c0\u6d4b<\/p>\n<p>    &#xff1a;\u6709\u4e00\u4e2a\u540e\u53f0\u4efb\u52a1\u6301\u7eed\u68c0\u6d4b\u4ee3\u7406\u7684\u533f\u540d\u5ea6\u3001\u5ef6\u8fdf\u548c\u53ef\u7528\u6027&#xff0c;\u5c06\u5931\u6548\u4ee3\u7406\u79fb\u51fa\u6c60\u5b50\u3002\n   <\/li>\n<li>\n<p>     \u8c03\u5ea6\u7b56\u7565<\/p>\n<p>    &#xff1a;\u968f\u673a\u4f7f\u7528\u3001\u6309\u5ef6\u8fdf\u52a0\u6743\u4f7f\u7528\u3001\u4e3a\u4e0d\u540c\u76ee\u6807\u7f51\u7ad9\u5206\u914d\u4e0d\u540c\u7684\u4ee3\u7406\u5b50\u6c60\u3002\n   <\/li>\n<\/ul>\n<\/li>\n<li>\n<p>   JavaScript\u6e32\u67d3<\/p>\n<p>  &#xff1a;\u5bf9\u4e8eSPA&#xff08;\u5355\u9875\u5e94\u7528&#xff09;\u7f51\u7ad9&#xff0c;\u5fc5\u987b\u4f7f\u7528\u65e0\u5934\u6d4f\u89c8\u5668\u3002\u9879\u76ee\u53ef\u80fd\u96c6\u6210\u4e86<\/p>\n<p>   playwright<\/p>\n<p>  \u6216<\/p>\n<p>   selenium<\/p>\n<p>  \u3002\u5173\u952e\u4f18\u5316\u5728\u4e8e<\/p>\n<p>   \u590d\u7528\u6d4f\u89c8\u5668\u5b9e\u4f8b<\/p>\n<p>  \u800c\u975e\u6bcf\u6b21\u8bf7\u6c42\u90fd\u542f\u52a8\u4e00\u4e2a&#xff0c;\u4ee5\u53ca<\/p>\n<p>   \u7981\u7528\u4e0d\u5fc5\u8981\u7684\u529f\u80fd<\/p>\n<p>  &#xff08;\u5982\u56fe\u7247\u52a0\u8f7d\u3001WebGL&#xff09;\u4ee5\u63d0\u5347\u901f\u5ea6\u3002\n <\/li>\n<li>\n<p>   \u9a8c\u8bc1\u7801\u8bc6\u522b<\/p>\n<p>  &#xff1a;\u7b80\u5355\u7684\u9a8c\u8bc1\u7801\u53ef\u80fd\u5c1d\u8bd5\u7528\u5f00\u6e90OCR\u5e93&#xff08;\u5982<\/p>\n<p>   ddddocr<\/p>\n<p>  \u3001<\/p>\n<p>   tesseract<\/p>\n<p>  &#xff09;\u7834\u89e3\u3002\u590d\u6742\u7684\u5219\u53ef\u80fd\u7559\u6709\u63a5\u53e3&#xff0c;\u53ef\u4ee5\u63a5\u5165\u7b2c\u4e09\u65b9\u6253\u7801\u5e73\u53f0&#xff08;\u5982\u8d85\u7ea7\u9e70\u3001\u56fe\u9274&#xff09;&#xff0c;\u76f8\u5173API\u5bc6\u94a5\u7684\u914d\u7f6e\u4f1a\u5728\u73af\u5883\u53d8\u91cf\u4e2d\u3002\n <\/li>\n<p>   \u5b9e\u64cd\u5fc3\u5f97<\/p>\n<p>  &#xff1a;\u53cd\u722c\u866b\u662f\u4e00\u573a\u6301\u4e45\u6218&#xff0c;\u6ca1\u6709\u4e00\u52b3\u6c38\u9038\u7684\u65b9\u6848\u3002\u6700\u597d\u7684\u7b56\u7565\u662f\u201c\u8c26\u5351\u201d\u548c\u201c\u5206\u6563\u201d\u3002\u4fdd\u6301\u8f83\u4f4e\u7684\u8bf7\u6c42\u9891\u7387&#xff0c;\u5408\u7406\u4f7f\u7528\u4ee3\u7406&#xff0c;\u5e76\u51c6\u5907\u597d\u968f\u65f6\u5207\u6362\u7b56\u7565\u3002\u5728\u4ee3\u7801\u4e2d&#xff0c;\u5e94\u5c06\u6240\u6709\u53cd\u722c\u7b56\u7565\u8bbe\u8ba1\u4e3a\u53ef\u63d2\u62d4\u7684\u201c\u4e2d\u95f4\u4ef6\u201d&#xff0c;\u65b9\u4fbf\u542f\u7528\u3001\u7981\u7528\u548c\u66ff\u6362\u3002\n <\/p>\n<h3>\n 5. \u9879\u76ee\u90e8\u7f72\u4e0e\u8fd0\u7ef4\u5b9e\u8df5<br \/>\n<\/h3>\n<p>\n \u4e00\u4e2a\u5b8c\u6574\u7684\u7cfb\u7edf\u9664\u4e86\u6838\u5fc3\u4ee3\u7801&#xff0c;\u8fd8\u79bb\u4e0d\u5f00\u90e8\u7f72\u548c\u8fd0\u7ef4\u7684\u652f\u6301\u3002\u4ece\u5f52\u6863\u4ed3\u5e93\u7684<\/p>\n<p>  docker\/<\/p>\n<p> \u76ee\u5f55\u3001<\/p>\n<p>  docker-compose.yml<\/p>\n<p> \u6587\u4ef6\u6216CI\/CD\u914d\u7f6e\u6587\u4ef6&#xff08;\u5982<\/p>\n<p>  .github\/workflows\/<\/p>\n<p> &#xff09;\u4e2d&#xff0c;\u6211\u4eec\u53ef\u4ee5\u7aa5\u89c1\u5176\u751f\u4ea7\u90e8\u7f72\u7684\u5f62\u6001\u3002\n<\/p>\n<h4>\n 5.1 \u5bb9\u5668\u5316\u90e8\u7f72<br \/>\n<\/h4>\n<p>\n \u73b0\u4ee3\u5e94\u7528\u90e8\u7f72\u7684\u9996\u9009\u662f\u5bb9\u5668\u5316\u3002\u9879\u76ee\u5f88\u53ef\u80fd\u63d0\u4f9b\u4e86Dockerfile\u3002\n<\/p>\n<p># \u793a\u4f8b Dockerfile<br \/>\nFROM python:3.9-slim<br \/>\nWORKDIR \/app<\/p>\n<p># \u5b89\u88c5\u7cfb\u7edf\u4f9d\u8d56&#xff0c;\u7279\u522b\u662f\u65e0\u5934\u6d4f\u89c8\u5668\u6240\u9700\u7684<br \/>\nRUN apt-get update &amp;&amp; apt-get install -y \\\\<br \/>\n    wget \\\\<br \/>\n    gnupg \\\\<br \/>\n    chromium \\\\<br \/>\n    chromium-driver \\\\<br \/>\n    &amp;&amp; rm -rf \/var\/lib\/apt\/lists\/*<\/p>\n<p># \u590d\u5236\u4f9d\u8d56\u6587\u4ef6\u5e76\u5b89\u88c5Python\u5305<br \/>\nCOPY requirements.txt .<br \/>\nRUN pip install &#8211;no-cache-dir -r requirements.txt -i https:\/\/pypi.tuna.tsinghua.edu.cn\/simple<\/p>\n<p># \u590d\u5236\u5e94\u7528\u4ee3\u7801<br \/>\nCOPY . .<\/p>\n<p># \u8bbe\u7f6e\u73af\u5883\u53d8\u91cf&#xff0c;\u5982\u6570\u636e\u5e93\u8fde\u63a5\u5b57\u7b26\u4e32\u3001\u4ee3\u7406API\u5bc6\u94a5\u7b49<br \/>\nENV PYTHONPATH&#061;\/app<br \/>\nENV TZ&#061;Asia\/Shanghai<\/p>\n<p># \u542f\u52a8\u547d\u4ee4&#xff0c;\u53ef\u80fd\u662f\u542f\u52a8\u8c03\u5ea6\u5668\u3001Worker\u6216Web\u7ba1\u7406\u754c\u9762<br \/>\nCMD [&#034;python&#034;, &#034;main.py&#034;, &#034;&#8211;mode&#034;, &#034;scheduler&#034;]<\/p>\n<p>\n \u914d\u5408<\/p>\n<p>  docker-compose.yml<\/p>\n<p> &#xff0c;\u53ef\u4ee5\u4e00\u952e\u542f\u52a8\u6574\u4e2a\u670d\u52a1\u6808&#xff0c;\u5305\u62ec\u722c\u866b\u5e94\u7528\u3001Redis\u961f\u5217\u3001MySQL\u6570\u636e\u5e93\u548cPrometheus\u76d1\u63a7\u3002\n<\/p>\n<p>version: &#039;3.8&#039;<br \/>\nservices:<br \/>\n  redis:<br \/>\n    image: redis:alpine<br \/>\n    ports:<br \/>\n      &#8211; &#034;6379:6379&#034;<br \/>\n  mysql:<br \/>\n    image: mysql:8.0<br \/>\n    environment:<br \/>\n      MYSQL_ROOT_PASSWORD: ${DB_PASSWORD}<br \/>\n    volumes:<br \/>\n      &#8211; mysql_data:\/var\/lib\/mysql<br \/>\n  crawler-scheduler:<br \/>\n    build: .<br \/>\n    command: [&#034;python&#034;, &#034;main.py&#034;, &#034;&#8211;mode&#034;, &#034;scheduler&#034;]<br \/>\n    depends_on:<br \/>\n      &#8211; redis<br \/>\n      &#8211; mysql<br \/>\n    environment:<br \/>\n      &#8211; REDIS_URL&#061;redis:\/\/redis:6379\/0<br \/>\n      &#8211; DATABASE_URL&#061;mysql:\/\/root:${DB_PASSWORD}&#064;mysql:3306\/crawler_db<br \/>\n    volumes:<br \/>\n      &#8211; .\/config:\/app\/config:ro<br \/>\n      &#8211; .\/data:\/app\/data<br \/>\n  crawler-worker:<br \/>\n    build: .<br \/>\n    command: [&#034;python&#034;, &#034;main.py&#034;, &#034;&#8211;mode&#034;, &#034;worker&#034;]<br \/>\n    depends_on:<br \/>\n      &#8211; redis<br \/>\n    environment:<br \/>\n      &#8211; REDIS_URL&#061;redis:\/\/redis:6379\/0<br \/>\n    deploy:<br \/>\n      replicas: 4 # \u542f\u52a84\u4e2aWorker\u5b9e\u4f8b&#xff0c;\u6a2a\u5411\u6269\u5c55<br \/>\n    volumes:<br \/>\n      &#8211; .\/config:\/app\/config:ro<\/p>\n<h4>\n 5.2 \u76d1\u63a7\u4e0e\u65e5\u5fd7<br \/>\n<\/h4>\n<p>\n \u8fd0\u7ef4\u7684\u6838\u5fc3\u662f\u53ef\u89c2\u6d4b\u6027\u3002\u9879\u76ee\u4ee3\u7801\u4e2d\u5e94\u8be5\u5e7f\u6cdb\u4f7f\u7528\u4e86\u65e5\u5fd7\u5e93&#xff08;\u5982<\/p>\n<p>  structlog<\/p>\n<p> \u6216<\/p>\n<p>  loguru<\/p>\n<p> &#xff09;&#xff0c;\u5e76\u8f93\u51fa\u7ed3\u6784\u5316\u7684JSON\u65e5\u5fd7&#xff0c;\u65b9\u4fbf\u88abELK&#xff08;Elasticsearch, Logstash, Kibana&#xff09;\u6216Loki\u6536\u96c6\u3002\n<\/p>\n<p>\n \u5173\u952e\u76d1\u63a7\u6307\u6807\u53ef\u80fd\u5305\u62ec&#xff1a;\n<\/p>\n<ul>\n<li>\n<p>   \u961f\u5217\u6df1\u5ea6<\/p>\n<p>  &#xff1a;Redis\u4e2d\u5f85\u5904\u7406\u4efb\u52a1\u7684\u6570\u91cf\u3002\n <\/li>\n<li>\n<p>   \u722c\u53d6\u901f\u7387<\/p>\n<p>  &#xff1a;\u6210\u529f\/\u5931\u8d25\u7684\u8bf7\u6c42\u6570 per minute\u3002\n <\/li>\n<li>\n<p>   \u54cd\u5e94\u65f6\u95f4\u5206\u5e03<\/p>\n<p>  &#xff1a;P50, P95, P99\u5ef6\u8fdf\u3002\n <\/li>\n<li>\n<p>   \u4ee3\u7406\u5065\u5eb7\u5ea6<\/p>\n<p>  &#xff1a;\u53ef\u7528\u4ee3\u7406\u6570\u4e0e\u603b\u4ee3\u7406\u6570\u7684\u6bd4\u4f8b\u3002\n <\/li>\n<li>\n<p>   \u6570\u636e\u4ea7\u51fa\u91cf<\/p>\n<p>  &#xff1a;\u6210\u529f\u5b58\u50a8\u7684\u6570\u636e\u6761\u76ee\u6570\u3002\n <\/li>\n<\/ul>\n<p>\n \u8fd9\u4e9b\u6307\u6807\u53ef\u4ee5\u901a\u8fc7\u5728\u4ee3\u7801\u5173\u952e\u70b9\u57cb\u70b9&#xff0c;\u5e76\u63a8\u9001\u5230Prometheus\u5ba2\u6237\u7aef\u5e93&#xff0c;\u6700\u7ec8\u5728Grafana\u4e0a\u5c55\u793a\u3002\n<\/p>\n<h4>\n 5.3 \u914d\u7f6e\u7ba1\u7406<br \/>\n<\/h4>\n<p>\n \u6240\u6709\u53ef\u53d8\u7684\u53c2\u6570&#xff0c;\u5982\u6570\u636e\u5e93\u8fde\u63a5\u3001API\u5bc6\u94a5\u3001\u5404\u7f51\u7ad9\u7684\u6293\u53d6\u9891\u7387\u3001\u4ee3\u7406\u670d\u52a1\u5668\u5217\u8868\u7b49&#xff0c;\u90fd\u5fc5\u987b\u901a\u8fc7\u73af\u5883\u53d8\u91cf\u6216\u5916\u90e8\u914d\u7f6e\u6587\u4ef6&#xff08;\u5982<\/p>\n<p>  config\/production.yaml<\/p>\n<p> &#xff09;\u6765\u7ba1\u7406&#xff0c;<\/p>\n<p>  \u7edd\u5bf9\u7981\u6b62<\/p>\n<p> \u786c\u7f16\u7801\u5728\u6e90\u7801\u4e2d\u3002<\/p>\n<p>  .env.example<\/p>\n<p> \u6587\u4ef6\u901a\u5e38\u5217\u51fa\u4e86\u6240\u6709\u9700\u8981\u7684\u73af\u5883\u53d8\u91cf\u3002\n<\/p>\n<h3>\n 6. \u4ece\u5f52\u6863\u9879\u76ee\u5b66\u4e60\u4e0e\u4e8c\u6b21\u5f00\u53d1\u6307\u5357<br \/>\n<\/h3>\n<p>\n \u9762\u5bf9\u4e00\u4e2a\u5f52\u6863\u9879\u76ee&#xff0c;\u6211\u4eec\u8be5\u5982\u4f55\u6709\u6548\u5b66\u4e60\u5e76\u53ef\u80fd\u5728\u6b64\u57fa\u7840\u4e0a\u8fdb\u884c\u4e8c\u6b21\u5f00\u53d1&#xff1f;\n<\/p>\n<li>\n<p>    \u7b2c\u4e00\u6b65&#xff1a;\u514b\u9686\u4e0e\u63a2\u7d22<\/p>\n<ul>\n<li>\n    \u514b\u9686\u4ed3\u5e93\u540e&#xff0c;\u9996\u5148\u9605\u8bfb<\/p>\n<p>     README.md<\/p>\n<p>    &#xff0c;\u8fd9\u662f\u9879\u76ee\u7684\u603b\u7eb2\u3002\u7136\u540e\u67e5\u770b\u76ee\u5f55\u7ed3\u6784&#xff0c;\u4e86\u89e3\u6a21\u5757\u5212\u5206\u3002\n   <\/li>\n<li>\n    \u4ed4\u7ec6\u9605\u8bfb<\/p>\n<p>     requirements.txt<\/p>\n<p>    \u6216<\/p>\n<p>     Pipfile<\/p>\n<p>    &#xff0c;\u4e86\u89e3\u5176\u6280\u672f\u6808\u548c\u4f9d\u8d56\u7248\u672c\u3002\n   <\/li>\n<\/ul>\n<\/li>\n<li>\n<p>    \u7b2c\u4e8c\u6b65&#xff1a;\u9759\u6001\u4ee3\u7801\u5206\u6790<\/p>\n<ul>\n<li>\n    \u4ece\u5165\u53e3\u6587\u4ef6&#xff08;\u5982<\/p>\n<p>     main.py<\/p>\n<p>    \u3001<\/p>\n<p>     cli.py<\/p>\n<p>    &#xff09;\u5f00\u59cb&#xff0c;\u987a\u7740\u4ee3\u7801\u6267\u884c\u6d41\u7a0b\u753b\u4e00\u4e2a\u7b80\u5355\u7684\u8c03\u7528\u5173\u7cfb\u56fe\u3002\n   <\/li>\n<li>\n    \u91cd\u70b9\u9605\u8bfb\u6838\u5fc3\u7684\u7c7b\u5b9a\u4e49&#xff0c;\u5982<\/p>\n<p>     Crawler<\/p>\n<p>    \u3001<\/p>\n<p>     Scheduler<\/p>\n<p>    \u3001<\/p>\n<p>     Parser<\/p>\n<p>    &#xff0c;\u7406\u89e3\u5b83\u4eec\u7684\u63a5\u53e3\u548c\u804c\u8d23\u3002\n   <\/li>\n<li>\n    \u67e5\u770b\u6d4b\u8bd5\u6587\u4ef6&#xff08;<\/p>\n<p>     tests\/<\/p>\n<p>    \u76ee\u5f55&#xff09;&#xff0c;\u6d4b\u8bd5\u7528\u4f8b\u662f\u7406\u89e3\u6a21\u5757\u529f\u80fd\u7684\u6700\u4f73\u6587\u6863\u3002\n   <\/li>\n<\/ul>\n<\/li>\n<li>\n<p>    \u7b2c\u4e09\u6b65&#xff1a;\u5c1d\u8bd5\u5728\u9694\u79bb\u73af\u5883\u4e2d\u8fd0\u884c<\/p>\n<ul>\n<li>\n    \u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u865a\u62df\u73af\u5883&#xff0c;\u5c1d\u8bd5\u5b89\u88c5\u4f9d\u8d56\u3002\u6ce8\u610f&#xff0c;\u65e7\u7248\u672c\u7684\u5e93\u53ef\u80fd\u4e0e\u65b0Python\u7248\u672c\u4e0d\u517c\u5bb9&#xff0c;\u53ef\u80fd\u9700\u8981\u624b\u52a8\u8c03\u6574\u6216\u5bfb\u627e\u66ff\u4ee3\u5e93\u3002\n   <\/li>\n<li>\n    \u4f18\u5148\u8fd0\u884c\u5355\u5143\u6d4b\u8bd5&#xff0c;\u770b\u662f\u5426\u80fd\u901a\u8fc7\u3002\u8fd9\u80fd\u9a8c\u8bc1\u57fa\u7840\u73af\u5883\u662f\u5426\u6b63\u5e38\u3002\n   <\/li>\n<li>\n    \u627e\u4e00\u4e2a\u7b80\u5355\u7684\u3001\u9879\u76ee\u81ea\u5e26\u7684\u793a\u4f8b\u914d\u7f6e\u6216\u811a\u672c\u8fd0\u884c&#xff0c;\u76ee\u6807\u662f\u770b\u5230\u201c\u5b83\u52a8\u8d77\u6765\u4e86\u201d&#xff0c;\u54ea\u6015\u53ea\u662f\u6293\u53d6\u4e00\u4e2a\u7b80\u5355\u7684\u793a\u4f8b\u7f51\u7ad9\u3002\n   <\/li>\n<\/ul>\n<\/li>\n<li>\n<p>    \u7b2c\u56db\u6b65&#xff1a;\u4e8c\u6b21\u5f00\u53d1\u4e0e\u73b0\u4ee3\u5316\u6539\u9020<\/p>\n<ul>\n<li>\n<p>     \u4f9d\u8d56\u5347\u7ea7<\/p>\n<p>    &#xff1a;\u8fd9\u662f\u6700\u5927\u7684\u6311\u6218\u3002\u53ef\u4ee5\u4f7f\u7528<\/p>\n<p>     pip-audit<\/p>\n<p>    \u68c0\u67e5\u5b89\u5168\u6f0f\u6d1e&#xff0c;\u6709\u8ba1\u5212\u5730\u9010\u6b65\u5347\u7ea7\u5173\u952e\u5e93&#xff08;\u5982<\/p>\n<p>     requests<\/p>\n<p>    -&gt;<\/p>\n<p>     httpx<\/p>\n<p>    ,<\/p>\n<p>     celery<\/p>\n<p>    \u7248\u672c\u5347\u7ea7&#xff09;\u3002\u52a1\u5fc5\u5728\u5347\u7ea7\u540e\u5145\u5206\u6d4b\u8bd5\u3002\n   <\/li>\n<li>\n<p>     \u67b6\u6784\u501f\u9274\u800c\u975e\u7167\u642c<\/p>\n<p>    &#xff1a;\u4f60\u53ef\u80fd\u4e0d\u9700\u8981\u5b8c\u5168\u590d\u523b\u6574\u4e2a\u7cfb\u7edf\u3002\u53ef\u4ee5\u501f\u9274\u5176\u4f18\u79c0\u7684\u8bbe\u8ba1\u6a21\u5f0f&#xff0c;\u6bd4\u5982\u5b83\u7684\u89c4\u5219\u5f15\u64ce\u8bbe\u8ba1\u3001\u5f02\u6b65\u4efb\u52a1\u8c03\u5ea6\u65b9\u5f0f&#xff0c;\u7136\u540e\u7528\u73b0\u4ee3\u6846\u67b6&#xff08;\u5982<\/p>\n<p>     Scrapy<\/p>\n<p>    \u7ed3\u5408<\/p>\n<p>     scrapy-playwright<\/p>\n<p>    &#xff09;\u91cd\u65b0\u5b9e\u73b0\u6838\u5fc3\u9700\u6c42\u3002\n   <\/li>\n<li>\n<p>     \u8865\u5168\u6587\u6863<\/p>\n<p>    &#xff1a;\u5f52\u6863\u9879\u76ee\u7684\u6587\u6863\u5f80\u5f80\u4e0d\u5168\u3002\u5728\u7406\u89e3\u4ee3\u7801\u7684\u8fc7\u7a0b\u4e2d&#xff0c;\u4e3a\u4f60\u8ba4\u4e3a\u91cd\u8981\u7684\u90e8\u5206\u6dfb\u52a0\u6ce8\u91ca&#xff0c;\u751a\u81f3\u64b0\u5199\u65b0\u7684\u8bbe\u8ba1\u6587\u6863&#xff0c;\u8fd9\u4e2a\u8fc7\u7a0b\u672c\u8eab\u5c31\u662f\u6df1\u5ea6\u5b66\u4e60\u3002\n   <\/li>\n<li>\n<p>     \u4fee\u590d\u95ee\u9898<\/p>\n<p>    &#xff1a;\u5728\u8fd0\u884c\u4e2d\u53ef\u80fd\u4f1a\u53d1\u73b0Bug\u3002\u5c1d\u8bd5\u7406\u89e3\u5e76\u4fee\u590d\u5b83\u4eec&#xff0c;\u8fd9\u662f\u6df1\u5165\u4ee3\u7801\u7ec6\u8282\u7684\u7edd\u4f73\u673a\u4f1a\u3002\n   <\/li>\n<\/ul>\n<\/li>\n<p>   \u5e38\u89c1\u95ee\u9898\u4e0e\u6392\u67e5<\/p>\n<p>  &#xff1a;\n <\/p>\n<ul>\n<li>\n<p>    \u4f9d\u8d56\u5b89\u88c5\u5931\u8d25<\/p>\n<p>   &#xff1a;\u6700\u5e38\u89c1\u3002\u5c1d\u8bd5\u964d\u4f4ePython\u7248\u672c&#xff08;\u5982\u7528Pyenv\u5207\u6362\u5230\u9879\u76ee\u539f\u751f\u76843.7&#xff09;&#xff0c;\u6216\u67e5\u627e\u65e7\u7248\u672c\u5e93\u7684\u66ff\u4ee3\u54c1\u3002\u5bf9\u4e8e\u65e0\u6cd5\u5b89\u88c5\u7684C\u6269\u5c55\u5e93&#xff0c;\u53ef\u80fd\u9700\u8981\u5bfb\u627e\u7eafPython\u5b9e\u73b0\u7684\u540e\u7ee7\u8005\u3002\n  <\/li>\n<li>\n<p>    \u8fd0\u884c\u65f6\u62a5\u9519&#xff08;\u5982SSL\u9519\u8bef\u3001\u5bfc\u5165\u9519\u8bef&#xff09;<\/p>\n<p>   &#xff1a;\u8fd9\u901a\u5e38\u662f\u7531\u4e8e\u73af\u5883\u6216\u4f9d\u8d56\u95ee\u9898\u3002\u4ed4\u7ec6\u9605\u8bfb\u9519\u8bef\u5806\u6808&#xff0c;\u5b83\u901a\u5e38\u4f1a\u6307\u5411\u7f3a\u5931\u7684\u6a21\u5757\u6216\u7cfb\u7edf\u5e93\u3002\u6839\u636e\u9519\u8bef\u4fe1\u606f\u641c\u7d22&#xff0c;\u5f80\u5f80\u80fd\u627e\u5230\u89e3\u51b3\u65b9\u6848\u3002\n  <\/li>\n<li>\n<p>    \u6293\u53d6\u4e0d\u5230\u6570\u636e<\/p>\n<p>   &#xff1a;\u9996\u5148\u68c0\u67e5\u7f51\u7edc\u548c\u4ee3\u7406\u914d\u7f6e\u3002\u7136\u540e\u4f7f\u7528\u6d4f\u89c8\u5668\u5f00\u53d1\u8005\u5de5\u5177&#xff0c;\u5bf9\u6bd4\u722c\u866b\u53d1\u9001\u7684\u8bf7\u6c42\u548c\u6d4f\u89c8\u5668\u53d1\u9001\u7684\u8bf7\u6c42\u5728Header\u3001Cookie\u3001\u53c2\u6570\u4e0a\u6709\u4f55\u4e0d\u540c&#xff0c;\u9010\u4e00\u8c03\u6574\u6a21\u62df\u3002\n  <\/li>\n<\/ul>\n<p>\n \u6700\u540e&#xff0c;\u5bf9\u5f85\u5f52\u6863\u9879\u76ee&#xff0c;\u5e94\u62b1\u6709\u4e00\u79cd\u201c\u8003\u53e4\u201d\u548c\u201c\u6dd8\u91d1\u201d\u7684\u5fc3\u6001\u3002\u5b83\u7684\u4e3b\u8981\u4ef7\u503c\u4e0d\u5728\u4e8e\u76f4\u63a5\u8fd0\u884c&#xff0c;\u800c\u5728\u4e8e\u5176\u8bbe\u8ba1\u601d\u60f3\u3001\u89e3\u51b3\u7279\u5b9a\u590d\u6742\u95ee\u9898\u7684\u6a21\u5f0f\u4ee5\u53ca\u7559\u4e0b\u7684\u7ecf\u9a8c\u6559\u8bad&#xff08;\u5305\u62ec\u90a3\u4e9b\u6ce8\u91ca\u6389\u7684\u4ee3\u7801\u548c\u672a\u5b8c\u6210\u7684TODO&#xff09;\u3002\u901a\u8fc7\u6df1\u5165\u5256\u6790\u50cf\u201copenclawbrain-archive\u201d\u8fd9\u6837\u7684\u9879\u76ee&#xff0c;\u4f60\u80fd\u83b7\u5f97\u7684\u4e0d\u4ec5\u4ec5\u662f\u722c\u866b\u6280\u672f&#xff0c;\u66f4\u662f\u5982\u4f55\u6784\u5efa\u4e00\u4e2a\u53ef\u7ef4\u62a4\u3001\u53ef\u6269\u5c55\u3001\u9c81\u68d2\u7684\u6570\u636e\u7ba1\u9053\u7cfb\u7edf\u7684\u67b6\u6784\u601d\u7ef4\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. \u9879\u76ee\u6982\u8ff0\u4e0e\u6838\u5fc3\u4ef7\u503c\u6700\u8fd1\u5728\u6574\u7406\u4e00\u4e9b\u65e7\u9879\u76ee\u8d44\u6599\u65f6&#xff0c;\u6211\u91cd\u65b0\u5ba1\u89c6\u4e86\u4e00\u4e2a\u540d\u4e3a\u201copenclawbrain-archive\u201d\u7684\u4ed3\u5e93\u3002\u8fd9\u4e2a\u9879\u76ee\u540d\u542c\u8d77\u6765\u6709\u70b9\u610f\u601d&#xff0c;\u7ed3\u5408\u4e86\u201copen\u201d&#xff08;\u5f00\u653e&#xff09;\u3001\u201cclaw\u201d&#xff08;\u722a\u5b50\/\u6293\u53d6&#xff09;\u548c\u201cbrain\u201d&#xff08;\u5927\u8111\/\u667a\u80fd&#xff09;&#xff0c;\u76f4\u8bd1\u8fc7\u6765\u5927\u6982\u662f\u201c\u5f00\u653e\u722a\u8111\u5b58\u6863\u201d\u3002\u4e4d\u4e00\u770b&#xff0c;\u4f60\u53ef\u80fd\u4f1a\u8054\u60f3\u5230\u67d0\u79cd\u673a\u5668\u4eba\u63a7\u5236\u6216\u6570\u636e\u6293\u53d6\u76f8\u5173\u7684\u667a\u80fd\u7cfb\u7edf\u3002\u5b9e\u9645\u4e0a&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":[11402,4263,2653],"topic":[],"class_list":["post-99683","post","type-post","status-publish","format-standard","hentry","category-server","tag-11402","tag-4263","tag-2653"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u4ece\u5f52\u6863\u9879\u76eeopenclawbrain-archive\u89e3\u6790\u6570\u636e\u91c7\u96c6\u4e0e\u667a\u80fd\u5904\u7406\u7cfb\u7edf\u67b6\u6784 - \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\/99683.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u4ece\u5f52\u6863\u9879\u76eeopenclawbrain-archive\u89e3\u6790\u6570\u636e\u91c7\u96c6\u4e0e\u667a\u80fd\u5904\u7406\u7cfb\u7edf\u67b6\u6784 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"1. \u9879\u76ee\u6982\u8ff0\u4e0e\u6838\u5fc3\u4ef7\u503c\u6700\u8fd1\u5728\u6574\u7406\u4e00\u4e9b\u65e7\u9879\u76ee\u8d44\u6599\u65f6&#xff0c;\u6211\u91cd\u65b0\u5ba1\u89c6\u4e86\u4e00\u4e2a\u540d\u4e3a\u201copenclawbrain-archive\u201d\u7684\u4ed3\u5e93\u3002\u8fd9\u4e2a\u9879\u76ee\u540d\u542c\u8d77\u6765\u6709\u70b9\u610f\u601d&#xff0c;\u7ed3\u5408\u4e86\u201copen\u201d&#xff08;\u5f00\u653e&#xff09;\u3001\u201cclaw\u201d&#xff08;\u722a\u5b50\/\u6293\u53d6&#xff09;\u548c\u201cbrain\u201d&#xff08;\u5927\u8111\/\u667a\u80fd&#xff09;&#xff0c;\u76f4\u8bd1\u8fc7\u6765\u5927\u6982\u662f\u201c\u5f00\u653e\u722a\u8111\u5b58\u6863\u201d\u3002\u4e4d\u4e00\u770b&#xff0c;\u4f60\u53ef\u80fd\u4f1a\u8054\u60f3\u5230\u67d0\u79cd\u673a\u5668\u4eba\u63a7\u5236\u6216\u6570\u636e\u6293\u53d6\u76f8\u5173\u7684\u667a\u80fd\u7cfb\u7edf\u3002\u5b9e\u9645\u4e0a&amp;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/99683.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-09-02T16:37:13+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\/99683.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/99683.html\",\"name\":\"\u4ece\u5f52\u6863\u9879\u76eeopenclawbrain-archive\u89e3\u6790\u6570\u636e\u91c7\u96c6\u4e0e\u667a\u80fd\u5904\u7406\u7cfb\u7edf\u67b6\u6784 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-09-02T16:37:13+00:00\",\"dateModified\":\"2026-09-02T16:37:13+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/99683.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/99683.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/99683.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u4ece\u5f52\u6863\u9879\u76eeopenclawbrain-archive\u89e3\u6790\u6570\u636e\u91c7\u96c6\u4e0e\u667a\u80fd\u5904\u7406\u7cfb\u7edf\u67b6\u6784\"}]},{\"@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":"\u4ece\u5f52\u6863\u9879\u76eeopenclawbrain-archive\u89e3\u6790\u6570\u636e\u91c7\u96c6\u4e0e\u667a\u80fd\u5904\u7406\u7cfb\u7edf\u67b6\u6784 - \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\/99683.html","og_locale":"zh_CN","og_type":"article","og_title":"\u4ece\u5f52\u6863\u9879\u76eeopenclawbrain-archive\u89e3\u6790\u6570\u636e\u91c7\u96c6\u4e0e\u667a\u80fd\u5904\u7406\u7cfb\u7edf\u67b6\u6784 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"1. \u9879\u76ee\u6982\u8ff0\u4e0e\u6838\u5fc3\u4ef7\u503c\u6700\u8fd1\u5728\u6574\u7406\u4e00\u4e9b\u65e7\u9879\u76ee\u8d44\u6599\u65f6&#xff0c;\u6211\u91cd\u65b0\u5ba1\u89c6\u4e86\u4e00\u4e2a\u540d\u4e3a\u201copenclawbrain-archive\u201d\u7684\u4ed3\u5e93\u3002\u8fd9\u4e2a\u9879\u76ee\u540d\u542c\u8d77\u6765\u6709\u70b9\u610f\u601d&#xff0c;\u7ed3\u5408\u4e86\u201copen\u201d&#xff08;\u5f00\u653e&#xff09;\u3001\u201cclaw\u201d&#xff08;\u722a\u5b50\/\u6293\u53d6&#xff09;\u548c\u201cbrain\u201d&#xff08;\u5927\u8111\/\u667a\u80fd&#xff09;&#xff0c;\u76f4\u8bd1\u8fc7\u6765\u5927\u6982\u662f\u201c\u5f00\u653e\u722a\u8111\u5b58\u6863\u201d\u3002\u4e4d\u4e00\u770b&#xff0c;\u4f60\u53ef\u80fd\u4f1a\u8054\u60f3\u5230\u67d0\u79cd\u673a\u5668\u4eba\u63a7\u5236\u6216\u6570\u636e\u6293\u53d6\u76f8\u5173\u7684\u667a\u80fd\u7cfb\u7edf\u3002\u5b9e\u9645\u4e0a&amp;","og_url":"https:\/\/www.wsisp.com\/helps\/99683.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-09-02T16:37:13+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\/99683.html","url":"https:\/\/www.wsisp.com\/helps\/99683.html","name":"\u4ece\u5f52\u6863\u9879\u76eeopenclawbrain-archive\u89e3\u6790\u6570\u636e\u91c7\u96c6\u4e0e\u667a\u80fd\u5904\u7406\u7cfb\u7edf\u67b6\u6784 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-09-02T16:37:13+00:00","dateModified":"2026-09-02T16:37:13+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/99683.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/99683.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/99683.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u4ece\u5f52\u6863\u9879\u76eeopenclawbrain-archive\u89e3\u6790\u6570\u636e\u91c7\u96c6\u4e0e\u667a\u80fd\u5904\u7406\u7cfb\u7edf\u67b6\u6784"}]},{"@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\/99683","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=99683"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/99683\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=99683"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=99683"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=99683"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=99683"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}