{"id":357,"date":"2019-07-23T18:50:52","date_gmt":"2019-07-23T10:50:52","guid":{"rendered":"http:\/\/blog.maoyunwang.top\/?p=357"},"modified":"2021-09-06T16:29:12","modified_gmt":"2021-09-06T08:29:12","slug":"python%e7%88%ac%e8%99%ab%e7%8e%af%e5%a2%83%e6%90%ad%e5%bb%ba","status":"publish","type":"post","link":"https:\/\/blog.tongyunli.top\/?p=357","title":{"rendered":"Python\u722c\u866b\u73af\u5883\u642d\u5efa"},"content":{"rendered":"<p>#\u521d\u59cb\u5316\u4f9d\u8d56\u5305<br \/>\nsudo apt-get install -y zlib1g-dev libbz2-dev libssl-dev libncurses5-dev libsqlite3-dev libreadline-dev tk-dev libgdbm-dev libdb-dev libpcap-dev xz-utils libexpat1-dev liblzma-dev libffi-dev libc6-dev<\/p>\n<p>#\u5b89\u88c5python<br \/>\nsudo apt-get install -y python3<\/p>\n<p>#\u5c5e\u4e8e\u7b2c\u4e09\u65b9\u5e93 \u670b\u53cb\u8bdd\u7b52 \u4e0d\u4f1a\u81ea\u5e26 \u9700\u8981\u624b\u52a8\u5b89\u88c5<br \/>\npip3 install requests<\/p>\n<p>#\u8fd9\u662f\u4e00\u4e2a\u81ea\u52a8\u5316\u6d4b\u8bd5\u5de5\u5177 \u53ef\u4ee5\u9a71\u52a8\u6d4f\u89c8\u5668\u6267\u884c\u7279\u5b9a\u7684\u52a8\u4f5c \u73b0\u7248\u672c\u5df2\u7ecf \u4e0d\u652f\u6301PhantomJS\uff08\u65e0\u754c\u9762\u5f0f\u6d4f\u89c8\u5668\uff09<br \/>\npip3 install selenium<\/p>\n<h1>\u8fd9\u662f\u4e00\u4e2a\u963b\u585e\u5f0f\u8bf7\u6c42\u7684HTTP\u8bf7\u6c42\u5e93<\/h1>\n<p>pip3 install aiohttp<\/p>\n<p>#lxml\u662fPython\u7684\u4e00\u4e2a\u89e3\u6790\u5e93\u652f\u6301xml html\u89e3\u6790 \u652f\u6301xpath<br \/>\npip3 install lxml<\/p>\n<p>#Beautiful Soup \u662fpython\u7684\u4e00\u4e2axml html\u89e3\u6790\u5e93<br \/>\npip3 install beautifulsoup4<\/p>\n<pre><code>#\u5b89\u88c5\u5b8c\u6210\u6d4b\u8bd5Demo\nfrom bs4 import BeautifulSoup\nsoup = BeautifulSoup('&lt;p&gt;Hello&lt;\/p&gt;','lxml')\nprint(soup.p.string)\n<\/code><\/pre>\n<p>#\u8fd9\u662f\u4e00\u4e2a\u7f51\u9875\u89e3\u6790\u5de5\u5177<br \/>\npip3 install pyquery<\/p>\n<p>#\u8fd9\u662f\u4e00\u4e2a\u56fe\u5f62\u9a8c\u8bc1\u7801\u7684OCR\u8bc6\u522b\u5e93<br \/>\nsudo apt-get install -y tesseract-ocr libtesseract-dev libleptonica-dev<\/p>\n<p>#\u5b89\u88c5python\u94fe\u63a5mysql\u5de5\u5177<br \/>\npip3 install pymysql<\/p>\n<p>#python\u94fe\u63a5MongoDB\u7684\u5de5\u5177<br \/>\npip3 install pymongo<\/p>\n<p>#\u5b89\u88c5pyhon\u94fe\u63a5redis\u6570\u636e\u5e93\u7684\u5de5\u5177<br \/>\npip3 install redis<\/p>\n<p>#\u5b89\u88c5RedisDump \u7528\u4e8eRedis\u6570\u636e\u5bfc\u51fa \u5bfc\u5165 \u57fa\u4e8eRuby\u5b9e\u73b0<\/p>\n<pre><code>#\u5b89\u88c5Ruby\nsudo apt-get install ruby-full\n\n#\u5b89\u88c5RedisDump\ngem install redis-dump\n\n#\u9a8c\u8bc1\u547d\u4ee4\nredis-dump\nredis-load\n<\/code><\/pre>\n<p>#\u5b89\u88c5Web\u5e93<\/p>\n<pre><code>#Flask \u8f7b\u91cf\u7ea7Web\u670d\u52a1\u7a0b\u5e8f\npip3 install flask\n\n#Tornado \u652f\u6301\u5f02\u6b65\u7684Web\u6846\u67b6\npip3 install tornado\n<\/code><\/pre>\n<p>#\u5b89\u88c5app\u722c\u53bb\u76f8\u5173\u5e93<br \/>\n                                    \u00d7\u00d7\u00d7\u00d7\u00d7\u00d7\u00d7\u5b89\u88c5\u5404\u79cd\u8bc1\u4e66\u00d7\u00d7\u00d7\u00d7\u00d7\u00d7\u00d7\u00d7\u00d7\u00d7<br \/>\n    #Charles \u4e00\u4e2a\u7f51\u7edc\u6293\u5305\u5de5\u5177\u8de8\u5e73\u53f0 \u6536\u8d39 \u53ef\u4f7f\u7528\u4e09\u5341\u5929 \u4e4b\u540e\u6bcf\u6b21\u8bd5\u7528\u4e0d\u8d85\u8fc7\u4e09\u5341\u5206\u949f<br \/>\n        https:\/\/www.charlesproxy.com\/latest-release\/download.do<br \/>\n        https:\/\/blog.csdn.net\/time_future\/article\/details\/82935375<\/p>\n<pre><code>#mitmproxy\u4e00\u4e2a\u652f\u6301http https \u7684\u6293\u5305\u7a0b\u5e8f \u63a7\u5236\u53f0\u5f0f\u7684\u64cd\u4f5c\npip3 install mitmproxy\n\n#appium\u79fb\u52a8\u7aef\u7684\u81ea\u52a8\u5316\u6d4b\u8bd5\u5de5\u5177\nhttps:\/\/pan.baidu.com\/s\/1jGvAISu#list\/path=%2F\n<\/code><\/pre>\n<p>#\u5b89\u88c5\u722c\u866b\u6846\u67b6<\/p>\n<pre><code>#pyspider \u56fd\u4eba binux\u7f16\u5199\u7684\u5f3a\u5927\u7f51\u7edc\u722c\u866b\u6846\u67b6 \u5e26webui \u811a\u672c\u7f16\u8f91\u5668 \u4efb\u52a1\u63a7\u5236\u5668 \u9879\u76ee\u7ba1\u7406\u5668 \u7ed3\u679c\u5904\u7406\u5668\uff08\u5439\u7206\uff09\u57fa\u4e8ejavascript \u9700\u8981\u5b89\u88c5Phantomjs\uff08\u4ee5\u4e0a\uff09\npip3 install pyspider\n    #err \u62a5\u9519Command \"python setup.py egg_info\" failed with error code 1 in \/tmp\/pip-build-wz733wu8\/pycurl\/\n       #\u89e3\u51b3\u65b9\u6cd5\u5b89\u88c5PyCurl\u5e93\n            sudo apt-get install libcurl4-gnutls-dev\n            sudo apt-get install libghc-gnutls-dev\n       #\u6700\u540e\u901a\u8fc7pip\u8fdb\u884c\u5b89\u88c5\uff1a\n       pip3 install pycurl\n    #err \u62a5\u9519ValueError: Invalid configuration:\n                  - Deprecated option 'domaincontroller': use 'http_authenticator.domain_controller' instead.\n        #\u89e3\u51b3\n        pip uninstall wsgidav\n        python -m pip install wsgidav==2.4.1\n#Scrapy\u5f3a\u5927\u7684\u722c\u866b\u6846\u67b6 \u4f9d\u8d56\u7684\u5e93\u6bd4\u8f83\u591a\n    #\u5b89\u88c5\u4f9d\u8d56\u5e93\n    sudo apt-get install build-essential python3-dev libssl-dev libffi-dev libxml2 libxml2-dev libxslt1-dev zlib1g-dev\n    pip3 install Scrapy\n    #\u9a8c\u8bc1\u5b89\u88c5\n    scrapy\n#Scrapy_Splash \u5728Scrapy\u4e2d\u652f\u6301js\u6e32\u67d3\u7684\u5de5\u5177\n    \u5b89\u88c5\u8fc7\u7a0b\n    \u5148\u5b89\u88c5Docker\n    \u7136\u540e\u6267\u884c\n    docker run -p 8050:8050 scrapinghub\/splash\n    \u5b88\u62a4\u59ff\u6001\u8fd0\u884c \u5173\u6389\u7a97\u53e3\u4f9d\u7136\u8fd0\u884c\n    docker run -d -p 8050:8050 scrapinghub\/splash\n    \u5b89\u88c5phthon\u5e93\n    pip3 install scrapy-splash\n#scrapy-Redis \u5206\u5e03\u5f0f\u6269\u5c55\u6a21\u5757 \u5b9e\u73b0Scrapy\u5206\u5e03\u5f0f\u722c\u866b\u642d\u5efa\n    pip3 install scrapy-redis\n    \/\/*****\u6ce8\u610f \u8fd9\u4e2a\u4e00\u5b9a\u8981\u4f7f\u7528root\u6743\u9650 \u4e0d\u7136\u4f1a\u62a5\u4e00\u4e2a \u201c\u6bb5\u9519\u8bef (\u6838\u5fc3\u5df2\u8f6c\u50a8)\u201d  \u8fd9\u4e2a\u9519 \u7b2c\u4e00\u6b21\u89c1\u5230 \u54c8hahah ******\\\\\n#\u90e8\u7f72\u76f8\u5173\u5e93\u5b89\u88c5\n    \/\/\u5206\u5e03\u5f0f\u722c\u866b docker\u96c6\u7fa4\n#Scrapyd \u662f\u4e00\u4e2a\u90e8\u7f72\u548c\u8fd0\u884cScrapy\u7684\u5de5\u5177 \u53ef\u4ee5\u5c06\u5199\u597d\u7684Scrapy\u9879\u76ee\u4e0a\u4f20\u5230\u4e91\u4e3b\u673a\n    pip3 install scrapyd\n    \u7136\u540e\u9700\u8981\u914d\u7f6e\u4e00\u4e2a\u6587\u4ef6 \/etc\/scrapyd\/scrapyd.conf\n#Scraprd-Clinent \u6253\u5305\u90e8\u7f72\n    pip3 install scrapyd-client\n#Scrapyd API \u5bf9Scraypd\u7684\u5c01\u88c5\n    pip3 install python-scrapyd-api\n#Scrapyrt \u4e3ascrapy\u63d0\u4f9b\u4e86\u4e00\u4e2a\u8c03\u5ea6\u7684http\u63a5\u53e3\n    pip3 install scrapyrt\n\n#Gerapy scrapy\u5206\u5e03\u5f0f\u7ba1\u7406\u6a21\u5757\n     pip3 install gerapy\n\n     \/\/**************** \u5b89\u88c5\u73af\u5883end *****************\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>#\u521d\u59cb\u5316\u4f9d\u8d56\u5305 sudo apt-get install -y zlib1g-dev libbz2-dev l [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[22],"class_list":["post-357","post","type-post","status-publish","format-standard","hentry","tag-projk"],"_links":{"self":[{"href":"https:\/\/blog.tongyunli.top\/index.php?rest_route=\/wp\/v2\/posts\/357","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.tongyunli.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.tongyunli.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.tongyunli.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.tongyunli.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=357"}],"version-history":[{"count":1,"href":"https:\/\/blog.tongyunli.top\/index.php?rest_route=\/wp\/v2\/posts\/357\/revisions"}],"predecessor-version":[{"id":821,"href":"https:\/\/blog.tongyunli.top\/index.php?rest_route=\/wp\/v2\/posts\/357\/revisions\/821"}],"wp:attachment":[{"href":"https:\/\/blog.tongyunli.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=357"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.tongyunli.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=357"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.tongyunli.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=357"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}