{"id":5694,"date":"2026-01-15T09:08:31","date_gmt":"2026-01-15T01:08:31","guid":{"rendered":"https:\/\/code.jishujc.com\/?p=5694"},"modified":"2026-01-15T09:08:31","modified_gmt":"2026-01-15T01:08:31","slug":"x-%e7%ab%99%e8%b5%84%e6%ba%90%e9%87%87%e9%9b%86%e8%b7%a8%e5%9f%9f%e9%99%90%e5%88%b6%ef%bc%9f%e8%a7%a3%e5%86%b3%e6%b5%8f%e8%a7%88%e5%99%a8%e5%90%8c%e6%ba%90%e7%ad%96%e7%95%a5%e7%9a%84%e9%87%87%e9%9b%86","status":"publish","type":"post","link":"https:\/\/www.qqjishu.com\/index.php\/2026\/01\/15\/x-%e7%ab%99%e8%b5%84%e6%ba%90%e9%87%87%e9%9b%86%e8%b7%a8%e5%9f%9f%e9%99%90%e5%88%b6%ef%bc%9f%e8%a7%a3%e5%86%b3%e6%b5%8f%e8%a7%88%e5%99%a8%e5%90%8c%e6%ba%90%e7%ad%96%e7%95%a5%e7%9a%84%e9%87%87%e9%9b%86\/","title":{"rendered":"x \u7ad9\u8d44\u6e90\u91c7\u96c6\u8de8\u57df\u9650\u5236\uff1f\u89e3\u51b3\u6d4f\u89c8\u5668\u540c\u6e90\u7b56\u7565\u7684\u91c7\u96c6\u6280\u5de7"},"content":{"rendered":"<p class=\"ds-markdown-paragraph\"><strong>\u4e00\u3001\u7406\u89e3\u8de8\u57df\u9650\u5236\u7684\u672c\u8d28<\/strong><br \/>\n\u8de8\u57df\u9650\u5236\uff0c\u5168\u79f0\u201c\u540c\u6e90\u7b56\u7565\u201d\uff08Same-Origin Policy\uff09\uff0c\u662f\u6d4f\u89c8\u5668\u51fa\u4e8e\u5b89\u5168\u8003\u8651\u5b9e\u65bd\u7684\u6838\u5fc3\u5b89\u5168\u7b56\u7565\u3002\u5b83\u7981\u6b62\u4e00\u4e2a\u6e90\u7684\u7f51\u9875\u811a\u672c\uff08\u5982 JavaScript\uff09\u4e0e\u53e6\u4e00\u4e2a\u6e90\u7684\u8d44\u6e90\u8fdb\u884c\u4ea4\u4e92\u3002<strong>\u8bf7\u6ce8\u610f\uff1a\u540c\u6e90\u7b56\u7565\u662f\u6d4f\u89c8\u5668\u7684\u884c\u4e3a\uff0c\u5e38\u89c4\u7684\u670d\u52a1\u5668\u7aefHTTP\u8bf7\u6c42\uff08\u5982Python\u7684requests\u5e93\uff09\u4e0d\u53d7\u6b64\u9650\u5236\u3002<\/strong>\u00a0\u56e0\u6b64\uff0c\u5f53\u4f60\u4f7f\u7528\u975e\u6d4f\u89c8\u5668\u5de5\u5177\u8fdb\u884c\u91c7\u96c6\u65f6\uff0c\u901a\u5e38\u4e0d\u4f1a\u9047\u5230\u8de8\u57df\u95ee\u9898\u3002<\/p>\n<p class=\"ds-markdown-paragraph\"><strong>\u4e8c\u3001\u6d4f\u89c8\u5668\u73af\u5883\u4e0b\u91c7\u96c6\u7684\u7ed5\u8fc7\u6280\u5de7<\/strong><br \/>\n\u5f53\u4f60\u5fc5\u987b\u4f7f\u7528\u6d4f\u89c8\u5668\u73af\u5883\uff08\u5982Selenium\u3001Puppeteer\uff09\u8fdb\u884c\u91c7\u96c6\uff0c\u4e14\u9700\u8981\u8bbf\u95ee\u8de8\u57df\u8d44\u6e90\u65f6\uff0c\u624d\u4f1a\u9047\u5230\u6b64\u95ee\u9898\u3002\u89e3\u51b3\u65b9\u6cd5\u5982\u4e0b\uff1a<\/p>\n<ol start=\"1\">\n<li>\n<p class=\"ds-markdown-paragraph\"><strong>\u7981\u7528\u6d4f\u89c8\u5668\u540c\u6e90\u7b56\u7565\uff08\u4ec5\u9650\u6d4b\u8bd5\uff09<\/strong>\uff1a\u5728\u542f\u52a8\u65e0\u5934\u6d4f\u89c8\u5668\u65f6\uff0c\u901a\u8fc7\u547d\u4ee4\u884c\u53c2\u6570\u7981\u7528\u5b89\u5168\u7279\u6027\u3002\u4f8b\u5982\uff0cChrome \u53ef\u4ee5\u6dfb\u52a0\u00a0<code>--disable-web-security<\/code>\u00a0\u548c\u00a0<code>--user-data-dir<\/code>\u00a0\u53c2\u6570\u3002<strong>\u8b66\u544a\uff1a\u6b64\u65b9\u6cd5\u6781\u4e0d\u5b89\u5168\uff0c\u4ec5\u7528\u4e8e\u672c\u5730\u5f00\u53d1\u548c\u6d4b\u8bd5\uff0c\u5207\u52ff\u7528\u4e8e\u751f\u4ea7\u73af\u5883\u6216\u8bbf\u95ee\u654f\u611f\u7f51\u7ad9\u3002<\/strong><\/p>\n<\/li>\n<li>\n<p class=\"ds-markdown-paragraph\"><strong>\u4f7f\u7528\u6d4f\u89c8\u5668\u63d2\u4ef6<\/strong>\uff1a\u4e3a\u4f60\u7684\u91c7\u96c6\u6d4f\u89c8\u5668\u5b89\u88c5\u5141\u8bb8\u8de8\u57df\u8bf7\u6c42\u7684\u63d2\u4ef6\uff0c\u4f46\u8fd9\u5728\u81ea\u52a8\u5316\u811a\u672c\u4e2d\u7ba1\u7406\u8d77\u6765\u8f83\u4e3a\u590d\u6742\u3002<\/p>\n<\/li>\n<li>\n<p class=\"ds-markdown-paragraph\"><strong>\u89c4\u907f\u7b56\u7565\uff1a\u76f4\u63a5\u8bf7\u6c42\u76ee\u6807API<\/strong>\uff1a\u8de8\u57df\u9650\u5236\u901a\u5e38\u53d1\u751f\u5728\u524d\u7aef\u811a\u672c\u4e2d\u3002\u6700\u6709\u6548\u7684\u201c\u7ed5\u8fc7\u201d\u65b9\u6cd5\u662f\u6839\u672c\u4e0d\u4ece\u6d4f\u89c8\u5668\u524d\u7aef\u53d1\u8d77\u8fd9\u4e2a\u8de8\u57df\u8bf7\u6c42\u3002\u800c\u662f\u901a\u8fc7\u5206\u6790\uff0c\u627e\u5230\u524d\u7aef\u811a\u672c\u6700\u7ec8\u8c03\u7528\u7684\u6570\u636e\u63a5\u53e3\uff08API\uff09\uff0c\u7136\u540e\u8ba9\u4f60\u7684\u91c7\u96c6\u7a0b\u5e8f\uff08\u65e0\u8bba\u662f\u6d4f\u89c8\u5668\u540e\u7aef\u8fd8\u662f\u72ec\u7acb\u811a\u672c\uff09\u76f4\u63a5\u5411\u8fd9\u4e2aAPI\u53d1\u9001HTTP\u8bf7\u6c42\u3002\u8fd9\u624d\u662f\u6cbb\u672c\u4e4b\u9053\u3002<\/p>\n<\/li>\n<\/ol>\n<p class=\"ds-markdown-paragraph\"><strong>\u4e09\u3001\u6838\u5fc3\u5efa\u8bae\uff1a\u8131\u79bb\u6d4f\u89c8\u5668\u73af\u5883<\/strong><br \/>\n\u5bf9\u4e8e\u7edd\u5927\u591a\u6570\u8d44\u6e90\u91c7\u96c6\u4efb\u52a1\uff0c\u6700\u63a8\u8350\u3001\u6700\u9ad8\u6548\u3001\u6700\u4e0d\u53d7\u8de8\u57df\u56f0\u6270\u7684\u65b9\u5f0f\u662f\uff1a<\/p>\n<ul>\n<li>\n<p class=\"ds-markdown-paragraph\"><strong>\u4f7f\u7528\u975e\u6d4f\u89c8\u5668\u7684HTTP\u5ba2\u6237\u7aef\u5e93<\/strong>\uff0c\u5982 Python \u7684\u00a0<code>requests<\/code>\u3001Node.js \u7684\u00a0<code>axios<\/code>\u3001Go \u7684\u00a0<code>net\/http<\/code>\u00a0\u7b49\u3002\u5b83\u4eec\u76f4\u63a5\u6a21\u62df HTTP \u8bf7\u6c42\uff0c\u4e0d\u53d7\u540c\u6e90\u7b56\u7565\u7ea6\u675f\uff0c\u6027\u80fd\u66f4\u9ad8\uff0c\u8d44\u6e90\u6d88\u8017\u66f4\u5c0f\u3002<\/p>\n<\/li>\n<li>\n<p class=\"ds-markdown-paragraph\">\u5206\u6790\u76ee\u6807\u7f51\u7ad9\u7684\u6570\u636e\u63a5\u53e3\uff0c\u7528\u4e0a\u8ff0\u5de5\u5177\u6a21\u62df\u8bf7\u6c42\uff0c\u83b7\u53d6\u7ed3\u6784\u5316\u7684\u6570\u636e\uff08\u901a\u5e38\u662f JSON \u683c\u5f0f\uff09\u3002<\/p>\n<\/li>\n<\/ul>\n<p class=\"ds-markdown-paragraph\"><strong>\u603b\u7ed3<\/strong><br \/>\n\u9762\u5bf9\u8de8\u57df\u9650\u5236\uff0c\u9996\u5148\u8981\u660e\u786e\u5b83\u662f\u5426\u662f\u201c\u771f\u95ee\u9898\u201d\u3002\u5bf9\u4e8e\u540e\u7aef\u91c7\u96c6\u811a\u672c\uff0c\u8de8\u57df\u4e0d\u662f\u969c\u788d\u3002\u5bf9\u4e8e\u5fc5\u987b\u4f7f\u7528\u6d4f\u89c8\u5668\u7684\u573a\u666f\uff0c\u53ef\u901a\u8fc7\u914d\u7f6e\u4e34\u65f6\u7981\u7528\u6216\u91c7\u7528\u76f4\u63a5\u8bf7\u6c42API\u7684\u65b9\u5f0f\u6765\u89c4\u907f\u3002\u59cb\u7ec8\u7262\u8bb0\uff0c\u6700\u4f18\u96c5\u7684\u89e3\u51b3\u65b9\u6848\u662f\u907f\u5f00\u6d4f\u89c8\u5668\u7684\u524d\u7aef\u9650\u5236\uff0c\u76f4\u51fb\u540e\u7aef\u6570\u636e\u6e90\u5934\u3002\u5728\u00a0<strong><a href=\"http:\/\/code.jishujc.com\/\" target=\"_blank\" rel=\"noopener noreferrer\">\u6c47code.jishujc.com<\/a><\/strong>\u00a0\u8fd9\u7c7b\u5de5\u5177\u4e2d\uff0c\u5176\u201cHTTP\u8bf7\u6c42\u201d\u6a21\u5f0f\u672c\u8d28\u4e0a\u5c31\u662f\u975e\u6d4f\u89c8\u5668\u65b9\u5f0f\uff0c\u80fd\u5929\u7136\u907f\u5f00\u8de8\u57df\u95ee\u9898\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u3001\u7406\u89e3\u8de8\u57df\u9650\u5236\u7684\u672c\u8d28 \u8de8\u57df\u9650\u5236\uff0c\u5168\u79f0\u201c\u540c\u6e90\u7b56\u7565\u201d\uff08Same-Origin Policy\uff09\uff0c\u662f\u6d4f\u89c8\u5668\u51fa\u4e8e\u5b89\u5168\u8003\u8651\u5b9e\u65bd\u7684\u6838\u5fc3\u5b89\u5168\u7b56\u7565\u3002\u5b83\u7981\u6b62\u4e00\u4e2a\u6e90\u7684\u7f51\u9875\u811a\u672c\uff08\u5982 JavaScript\uff09\u4e0e\u53e6\u4e00\u4e2a\u6e90\u7684\u8d44\u6e90\u8fdb\u884c\u4ea4\u4e92\u3002\u8bf7\u6ce8\u610f\uff1a\u540c\u6e90\u7b56\u7565\u662f\u6d4f\u89c8\u5668\u7684\u884c\u4e3a\uff0c\u5e38\u89c4\u7684\u670d\u52a1\u5668\u7aefHTTP\u8bf7\u6c42\uff08\u5982Python\u7684requests\u5e93\uff09\u4e0d\u53d7\u6b64\u9650\u5236\u3002\u00a0\u56e0\u6b64\uff0c\u5f53\u4f60\u4f7f\u7528\u975e\u6d4f\u89c8\u5668\u5de5\u5177\u8fdb\u884c\u91c7\u96c6\u65f6\uff0c\u901a\u5e38\u4e0d\u4f1a\u9047\u5230\u8de8\u57df\u95ee\u9898\u3002 \u4e8c\u3001\u6d4f\u89c8\u5668\u73af\u5883\u4e0b\u91c7\u96c6\u7684\u7ed5\u8fc7\u6280\u5de7 \u5f53\u4f60\u5fc5\u987b\u4f7f\u7528\u6d4f\u89c8\u5668\u73af\u5883\uff08\u5982Selenium\u3001Puppeteer\uff09\u8fdb\u884c\u91c7\u96c6\uff0c\u4e14\u9700\u8981\u8bbf\u95ee\u8de8\u57df\u8d44\u6e90\u65f6\uff0c\u624d\u4f1a\u9047\u5230\u6b64\u95ee<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[28],"tags":[],"collection":[],"class_list":["post-5694","post","type-post","status-publish","format-standard","hentry","category-qtjc"],"_links":{"self":[{"href":"https:\/\/www.qqjishu.com\/index.php\/wp-json\/wp\/v2\/posts\/5694","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.qqjishu.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.qqjishu.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.qqjishu.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.qqjishu.com\/index.php\/wp-json\/wp\/v2\/comments?post=5694"}],"version-history":[{"count":0,"href":"https:\/\/www.qqjishu.com\/index.php\/wp-json\/wp\/v2\/posts\/5694\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.qqjishu.com\/index.php\/wp-json\/wp\/v2\/media?parent=5694"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.qqjishu.com\/index.php\/wp-json\/wp\/v2\/categories?post=5694"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.qqjishu.com\/index.php\/wp-json\/wp\/v2\/tags?post=5694"},{"taxonomy":"collection","embeddable":true,"href":"https:\/\/www.qqjishu.com\/index.php\/wp-json\/wp\/v2\/collection?post=5694"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}