{"id":288719,"date":"2023-12-05T21:11:53","date_gmt":"2023-12-05T13:11:53","guid":{"rendered":"https:\/\/lrxjmw.cn\/qsjywtllqlxt.html"},"modified":"2023-12-05T21:11:53","modified_gmt":"2023-12-05T13:11:53","slug":"qsjywtllqlxt","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/qsjywtllqlxt.html","title":{"rendered":"\u8f7b\u677e\u9a7e\u9a6d\u65e0\u5934\u6d4f\u89c8\u5668\uff01Linux\u7cfb\u7edf\u4e0a\u5b89\u88c5PhantomJS\u6307\u5357"},"content":{"rendered":"

PhantomJS\u662f\u4e00\u6b3e\u5f3a\u5927\u7684\u65e0\u5934\u6d4f\u89c8\u5668\uff0c\u5b83\u80fd\u591f\u6a21\u62df\u7528\u6237\u5728\u6d4f\u89c8\u5668\u4e2d\u7684\u4ea4\u4e92\u884c\u4e3aphantomjs linux \u5b89\u88c5<\/a><\/strong>\uff0c\u5e2e\u52a9\u5f00\u53d1\u8005\u8fdb\u884c\u81ea\u52a8\u5316\u6d4b\u8bd5\u3001\u9875\u9762\u622a\u56fe\u3001\u7f51\u7edc\u76d1\u63a7\u7b49\u5de5\u4f5c\u3002\u672c\u6587\u5c06\u4e3a\u5927\u5bb6\u4ecb\u7ecd\u5982\u4f55\u5728Linux<\/a>\u7cfb\u7edf<\/a>\u4e0a\u5b89\u88c5PhantomJSlinux\u5e38\u7528\u547d\u4ee4\u7ea2\u65d7linux\u4e0b\u8f7d\uff0c\u8ba9\u4f60\u8f7b\u677e\u9a7e\u9a6d\u65e0\u5934\u6d4f\u89c8\u5668\uff01<\/p>\n

1.\u5b89\u88c5\u4f9d\u8d56\u73af\u5883<\/b><\/p>\n

\u5728\u5f00\u59cb\u5b89\u88c5PhantomJS\u4e4b\u524d\uff0c\u6211\u4eec\u9700\u8981\u5148\u5b89\u88c5\u4e00\u4e9b\u5fc5\u8981\u7684\u4f9d\u8d56\u73af\u5883\u3002\u6253\u5f00\u7ec8\u7aef\uff0c\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4<\/a>\uff1a<\/p>\n

\n

\nsudo apt-get install -y build-essential chrpath libssl-dev libxft-dev\nsudo apt-get install -y libfreetype6 libfreetype6-dev libfontconfig1 libfontconfig1-dev\n<\/pre>\n<\/p>\n

2.\u4e0b\u8f7dPhantomJS\u5b89\u88c5\u5305<\/b><\/p>\n

\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u9700\u8981\u4e0b\u8f7dPhantomJS\u7684\u5b89\u88c5\u5305\u3002\u5728\u7ec8\u7aef\u4e2d\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n

\n

\nwget \n<\/pre>\n<\/p>\n

3.\u89e3\u538b\u5b89\u88c5\u5305<\/b><\/p>\n

\u4e0b\u8f7d\u5b8c\u6210\u540e\uff0c\u6211\u4eec\u9700\u8981\u89e3\u538b\u5b89\u88c5\u5305\u3002\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n

\n

\ntar xvjf phantomjs-2.1.1-linux-x86_64.tar.bz2\n<\/pre>\n<\/p>\n

4.\u79fb\u52a8\u6587\u4ef6<\/b><\/p>\n

\u89e3\u538b\u540ephantomjs linux \u5b89\u88c5<\/strong>\uff0c\u6211\u4eec\u5c06PhantomJS\u7684\u53ef\u6267\u884c\u6587\u4ef6\u79fb\u52a8\u5230\u7cfb\u7edf\u8def\u5f84\u4e0b\uff0c\u4ee5\u4fbf\u5168\u5c40\u4f7f\u7528\u3002\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n

\n

\nsudo mv phantomjs-2.1.1-linux-x86_64\/bin\/phantomjs \/usr\/local\/bin\/\n<\/pre>\n<\/p>\n

5.\u914d\u7f6e\u73af\u5883\u53d8\u91cf<\/a><\/b><\/p>\n

\u5b89\u88c5\u4e0b\u8f7d\u5e94\u7528_phantomjs linux \u5b89\u88c5_\u5b89\u88c5\u5305<\/p>\n

\u4e3a\u4e86\u65b9\u4fbf\u4f7f\u7528\uff0c\u6211\u4eec\u9700\u8981\u914d\u7f6e\u4e00\u4e0b\u73af\u5883\u53d8\u91cf\u3002\u6253\u5f00\u7ec8\u7aef\uff0c\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n

\n

\nsudo nano \/etc\/profile.d\/phantomjs.sh\n<\/pre>\n<\/p>\n

\u5728\u6253\u5f00\u7684\u6587\u4ef6\u4e2d\u6dfb\u52a0\u4ee5\u4e0b\u5185\u5bb9\uff1a<\/p>\n

\n

\nexport PHANTOMJS_HOME=\/usr\/local\/bin\/phantomjs\nexport PATH=$PHANTOMJS_HOME\/bin:$PATH\n<\/pre>\n<\/p>\n

phantomjs linux \u5b89\u88c5_\u5b89\u88c5\u5305_\u5b89\u88c5\u4e0b\u8f7d\u5e94\u7528<\/p>\n

\u4fdd\u5b58\u5e76\u9000\u51fa\u6587\u4ef6\u3002<\/p>\n

6.\u4f7f\u73af\u5883\u53d8\u91cf\u751f\u6548<\/b><\/p>\n

\u4e3a\u4e86\u8ba9\u521a\u624d\u914d\u7f6e\u7684\u73af\u5883\u53d8\u91cf\u751f\u6548\uff0c\u6211\u4eec\u9700\u8981\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n

\n

\nsource \/etc\/profile.d\/phantomjs.sh\n<\/pre>\n<\/p>\n

7.\u9a8c\u8bc1\u5b89\u88c5<\/b><\/p>\n

\u6700\u540e\uff0c\u6211\u4eec\u53ef\u4ee5\u9a8c\u8bc1\u4e00\u4e0bPhantomJS\u662f\u5426\u6210\u529f\u5b89\u88c5\u3002\u5728\u7ec8\u7aef\u4e2d\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n

\n

\nphantomjs --version\n<\/pre>\n<\/p>\n

\u5982\u679c\u8f93\u51fa\u4e86PhantomJS\u7684\u7248\u672c\u4fe1\u606f\uff0c\u5219\u8bf4\u660e\u5b89\u88c5\u6210\u529f\uff01<\/p>\n

\u901a\u8fc7\u4ee5\u4e0a\u4e03\u4e2a\u6b65\u9aa4\uff0c\u4f60\u5df2\u7ecf\u6210\u529f\u5728Linux\u7cfb\u7edf\u4e0a\u5b89\u88c5\u4e86PhantomJS\u3002\u73b0\u5728\u4f60\u53ef\u4ee5\u5c3d\u60c5\u5730\u4eab\u53d7\u65e0\u5934\u6d4f\u89c8\u5668\u5e26\u6765\u7684\u4fbf\u5229\u4e86\uff01\u5982\u679c\u4f60\u60f3\u6df1\u5165\u4e86\u89e3\u66f4\u591a\u5173\u4e8ePhantomJS\u7684\u4f7f\u7528\u548c\u5e94\u7528\uff0c\u8bf7\u53c2\u8003\u5b98\u65b9\u6587\u6863\u3002<\/p>\n

\u5e0c\u671b\u672c\u6587\u5bf9\u4f60\u6709\u6240\u5e2e\u52a9\uff0c\u5982\u679c\u6709\u4efb\u4f55\u95ee\u9898\uff0c\u8bf7\u968f\u65f6\u5411\u6211\u4eec\u53cd\u9988\u3002\u795d\u4f60\u5728\u4f7f\u7528PhantomJS\u7684\u8fc7\u7a0b\u4e2d\u53d6\u5f97\u66f4\u591a\u7684\u6210\u529f\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"

PhantomJS\u662f\u4e00\u6b3e\u5f3a\u5927\u7684\u65e0\u5934\u6d4f\u89c8\u5668\uff0c\u5b83\u80fd\u591f\u6a21\u62df\u7528\u6237\u5728\u6d4f\u89c8\u5668\u4e2d\u7684\u4ea4\u4e92\u884c\u4e3a\uff0c\u5e2e\u52a9\u5f00\u53d1\u8005\u8fdb\u884c\u81ea\u52a8\u5316\u6d4b\u8bd5\u3001\u9875\u9762\u622a\u56fe\u3001\u7f51\u7edc\u76d1\u63a7\u7b49\u5de5\u4f5c\u3002\u672c\u6587\u5c06\u4e3a\u5927\u5bb6\u4ecb\u7ecd\u5982\u4f55\u5728Linux\u7cfb\u7edf\u4e0a\u5b89\u88c5PhantomJS\uff0c\u8ba9\u4f60\u8f7b\u677e\u9a7e\u9a6d\u65e0\u5934\u6d4f\u89c8\u5668\uff01\u73b0\u5728\u4f60\u53ef\u4ee5\u5c3d\u60c5\u5730\u4eab\u53d7\u65e0\u5934\u6d4f\u89c8\u5668\u5e26\u6765\u7684\u4fbf\u5229\u4e86\uff01<\/p>\n","protected":false},"author":1,"featured_media":288720,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[988],"tags":[999],"class_list":["post-288719","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tougao","tag-999"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/288719","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=288719"}],"version-history":[{"count":0,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/288719\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/288720"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=288719"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=288719"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=288719"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}