{"id":169680,"date":"2023-08-03T16:08:24","date_gmt":"2023-08-03T08:08:24","guid":{"rendered":"http:\/\/www.idc.net\/help\/169680\/"},"modified":"2023-08-03T16:08:24","modified_gmt":"2023-08-03T08:08:24","slug":"%e5%90%8e%e6%b5%aa%e4%ba%91python%e6%95%99%e7%a8%8b%ef%bc%9apython-%e6%80%8e%e4%b9%88%e8%b0%83%e7%94%a8js","status":"publish","type":"post","link":"https:\/\/idc.net\/help\/169680\/","title":{"rendered":"\u540e\u6d6a\u4e91Python\u6559\u7a0b\uff1apython \u600e\u4e48\u8c03\u7528js"},"content":{"rendered":"<p style=\"text-align: center\"><img decoding=\"async\" src=\"https:\/\/oss.py.cn\/pycn\/upload\/article\/000\/000\/003\/5da97c55e6891881.jpg\" class=\"aligncenter\"><\/p>\n<p>Python \u8c03\u7528JS\u6587\u4ef6\u4e2d\u7684\u51fd\u6570\u65b9\u6cd5\uff0c\u5982\u4e0b\uff1a<\/p>\n<p><strong>1\u3001\u5b89\u88c5PyExecJS\u7b2c\u4e09\u65b9\u5e93<\/strong><\/p>\n<p style=\"text-align:center\"><img decoding=\"async\" src=\"https:\/\/oss.py.cn\/pycn\/upload\/image\/343\/553\/304\/1571388426987786.png\" style=\"width: 694px;height: 195px\" class=\"aligncenter\"><\/p>\n<p>\u76f8\u5173\u63a8\u8350\uff1a\u300aPython\u5165\u95e8\u6559\u7a0b\u300b<\/p>\n<p><strong>2\u3001\u5bfc\u5165\u5e93\uff1aimport execjs<\/strong><\/p>\n<p><strong>3\u3001\u8c03\u7528JS\u6587\u4ef6\u4e2d\u7684\u65b9\u6cd5<\/strong><\/p>\n<pre>Passwd&nbsp;=&nbsp;execjs.compile(open(r\"web.js\").read().decode(\"utf-8\")).call('loginHandle'\uff0c'steam')<\/pre>\n<p>\u8bed\u53e5\u89e3\u6790\uff0copen\u540e\u8ddf\u6240\u6267\u884c\u7684js\u6587\u4ef6\u4f4d\u7f6e\uff0ccall\u540e\u7b2c\u4e00\u4e2a\u5355\u5f15\u53f7\u5f15\u8d77\u6765\u7684\u4e3a\u6240\u6267\u884c\u7684js\u6587\u4ef6\u7684\u67d0\u4e2afunction\uff0c<\/p>\n<p>\u7b2c\u4e8c\u4e2a\u5355\u5f15\u53f7\u662f\u524d\u9762\u51fd\u6570\u7684\u53c2\u6570<\/p>\n<p>\u8fd9\u91cc\u4e3afunction loginHandle\uff08steam\uff09{...},\u7b2c\u4e00\u4e2a\u9017\u53f7\u540e\u4e3a\u5e26\u5165function\u7684\u53c2\u6570\uff0c\u4e0b\u56fe\u4e3ajs\u6587\u4ef6\u4e2d\u7684\u8be5\u51fd\u6570\uff1a<\/p>\n<p style=\"text-align:center\"><img decoding=\"async\" src=\"https:\/\/oss.py.cn\/pycn\/upload\/image\/597\/653\/511\/1571388439662848.png\" style=\"width: 304px;height: 235px\" class=\"aligncenter\"><\/p>\n<p>\u4ee3\u7801\uff1a<\/p>\n<pre>import&nbsp;execjs\n&nbsp;\nPasswd&nbsp;=&nbsp;execjs.compile(open(r\"web.js\").read().decode(\"utf-8\")).call('loginHandle'\uff0c'steam')\nprint&nbsp;Passwd<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Python \u8c03\u7528JS\u6587\u4ef6\u4e2d\u7684\u51fd\u6570\u65b9\u6cd5\uff0c\u5982\u4e0b\uff1a 1\u3001\u5b89\u88c5PyExecJS\u7b2c\u4e09\u65b9\u5e93 \u76f8\u5173\u63a8\u8350\uff1a\u300aPython\u5165\u95e8 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":169681,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[182397],"tags":[],"class_list":["post-169680","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python"],"_links":{"self":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts\/169680","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/comments?post=169680"}],"version-history":[{"count":0,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts\/169680\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/media\/169681"}],"wp:attachment":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/media?parent=169680"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/categories?post=169680"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/tags?post=169680"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}