{ "info": { "author": "simon", "author_email": "simon@yesiming.com", "bugtrack_url": null, "classifiers": [], "description": "\u601d\u660e\u7684\u4e2a\u4eba\u5de5\u5177\u5e93\n=================\n\n\u8be5\u5de5\u5177\u5e93\u4e3b\u8981\u662f\u628a\u6211\u5e73\u65f6\u5e38\u7528\u7684SEO\u4ee3\u7801\u3001\u6570\u636e\u91c7\u96c6\u4ee3\u7801\u8fdb\u884c\u5c01\u88c5\uff0c\u65b9\u4fbf\u5728\u4e0d\u540c\u7684\u9879\u76ee\u4e2d\u5f15\u7528\u3002\n\u5982\u679c\u4f60\u4f7f\u7528\u8be5\u5de5\u5177\u5e93\uff0c\u672c\u4eba\u65e0\u6cd5\u4fdd\u8bc1\u4ee3\u7801\u7684\u7a33\u5b9a\u6027\u3002\n\n\n\u5b89\u88c5\n======\npip install ysmtool\n\n\n\u4f7f\u7528\n======\n\nimport ysmtool\n\nHttp\u6a21\u5757\n=========\n\nhttp=ysmtool.Http()\n\nstatus,html=http.get(\"https://www.baidu.com\")\n\n\u6709get \u548c post \u65b9\u6cd5, \u8fd4\u56de (status,html) , status \u4e3a \u8bf7\u6c42\u8fd4\u56de\u7684\u72b6\u6001\u7801,\u6570\u503c\u578b\u3002\n\nip:\u6307\u5b9a\u672c\u5730\u51fa\u53e3IP\uff0c\u5982\u679c\u662f\u591a\u7f51\u5361\u670d\u52a1\u5668\uff0c\u8bbe\u7f6e\u4e3a\u76f8\u5e94\u7f51\u5361\u7ed1\u5b9a\u7684IP\u5730\u5740\uff0c\u5c31\u4f1a\u4ece\u6307\u5b9a\u7f51\u5361\u8fdb\u884c\u8bf7\u6c42\n\ngbk:\u5982\u679c\u8fd4\u56de\u7684\u6e90\u7801\u662fgb2312,gbk\u4e4b\u7c7b\u7684\uff0c\u8bbe\u7f6e\u4e3aTrue\n\nserverIp:\u6307\u5b9a\u57df\u540d\u5bf9\u5e94\u7684IP\uff0c\u53ef\u4ee5\u514d\u89e3\u6790\uff0c\u6216\u8005\u622a\u6301\n\nua: user_agent\n\ncookie: cookie\u6587\u672c\n\nserverPort:\u7f51\u7ad9\u5bf9\u5e94\u7684\u7aef\u53e3\n\nhttp.get(self,url,ip=None,ua='',refer='',cookie='',gbk=False,serverIp='',serverPort='')\n\nhttp.post(self,url,ip=None,ua='',refer='',cookie='',data={},gbk=False,serverIp='',serverPort='')\n\ntool\u6a21\u5757\n===========\n\nbs=ysmtool.tool.soup(html)\n\u5c06html\u8f6c\u4e3aBeautifulSoup\u5bf9\u8c61\n\nstr=ysmtool.tool.urlencode(str)\n\u5bf9\u5b57\u7b26\u4e32\u8fdb\u884curl\u7f16\u7801\n\nmd5str=ysmtool.tool.md5(str)\n\u5bf9\u5b57\u7b26\u4e32\u8fdb\u884cmd5\n\njsontxt=ysmtool.tool.json_encode(obj)\n\u5bf9json\u5bf9\u8c61\u8f6c\u5316\u6210json\u5b57\u7b26\u4e32,\u51fa\u9519\u65f6 jsontxt==None\n\n\nobj=ysmtool.tool.json_decode(jsontxt)\n\u89e3\u6790json\u5b57\u7b26\u4e32,\u51fa\u9519\u65f6 obj==None\n\n\nbaidu\u6a21\u5757\n=========\n\nstatus,num=ysmtool.baidu.index('www.taobao.com')\n\u6dd8\u5b9d\u7684\u767e\u5ea6\u6536\u5f55 , \u6b63\u5e38\u8fd4\u56de\u7684\u8bdd\uff0c status == 200\n\nstatus,result=ysmtool.baidu.search('\u8fde\u8863\u88d9',1,10)\n\u767e\u5ea6\u641c\u7d22\u201c\u8fde\u8863\u88d9\u201d\uff0c\u8fd4\u56de\u7b2c\u4e00\u9875\u7684\u7ed3\u679c, \u6b63\u5e38\u8fd4\u56de\u7684\u8bdd\uff0c status == 200\n\u7b2c\u4e09\u4e2a\u53c2\u6570\u4e3a\u6bcf\u9875\u663e\u793a\u6761\u6570\uff0c\u9ed8\u8ba410,\u53ea\u80fd\u8bbe\u7f6e\u4e3a10,20,30,40,50\n\nif status==200 and result:\n for item in result['items']:\n print item['title'],item['url']\n\n\u5f53\u67e5\u8be2\u4e3a\u7b2c1\u9875\u65f6\uff0cresult['total'] \u4e3a\u76f8\u5173\u7ed3\u679c\u6570:\n\nstatus,result=ysmtool.baidu.search('site:www.yesiming.com',1)\nif status==200 and result:\n print result['total'] #\u6536\u5f55\u6570\n\n\u51e4\u5de2\u5173\u952e\u8bcd\u89c4\u5212\u5e08\u62d3\u8bcd\u529f\u80fd,\u9700\u8981\u7f51\u9875\u7aef\u767b\u5f55\uff0c\u7136\u540e\u6293\u5305\u8bb0\u5f55cookie\u548c\u76f8\u5173\u4fe1\u606f\n\u6bcf\u6b21\u6700\u591a\u8fd4\u56de1000\u4e2a\u76f8\u5173\u5173\u952e\u8bcd,\nkwc:\u7ade\u4e89\u6fc0\u70c8\u7a0b\u5ea6\npv:\u6574\u4f53\u65e5\u5747\u641c\u7d22\u6570\npcShow:pc\u641c\u7d22\u6570\nwiseShow:\u79fb\u52a8\u641c\u7d22\u6570\nshowReason: \u5c55\u73b0\u7406\u7531\uff0c\u6570\u7ec4\u7ed3\u6784 ['\u9ed1\u9a6c','\u591c\u95f4\u597d\u8bcd']\ntotalWeight: \u603b\u6743\u91cd\uff0c\u4e0d\u77e5\u9053\u4ec0\u4e48\u9b3c\n\nreqid=''\neventId=''\ntoken=''\nuserid=''\ncookie=''\n\npage=1\nstatus,words=ysmtool.baidu.fengchao('\u53cc\u98de\u71d5\u9f20\u6807',cookie,token,userid,eventId,reqid,page)\nif status==200:\n for word in words:\n print word['word'],word['kwc'],word['pv'],word['pcShow'],word['wiseShow'],word['showReason'],word['totalWeight']\n\n\n\nhaosou\u6a21\u5757\n==========\n\nstatus,num=ysmtool.haosou.index('www.taobao.com')\n\u6dd8\u5b9d\u7684360\u6536\u5f55 \uff0c \u6b63\u5e38\u8fd4\u56de\u7684\u8bdd\uff0c status == 200\n\nstatus,result=ysmtool.haosou.search('\u8fde\u8863\u88d9',1)\n360\u641c\u7d22\u201c\u8fde\u8863\u88d9\u201d\uff0c\u8fd4\u56de\u7b2c\u4e00\u9875\u7684\u7ed3\u679c , \u6b63\u5e38\u8fd4\u56de\u7684\u8bdd\uff0c status == 200\n\nif status==200 and result:\n for item in result['items']:\n print item['title'],item['url']\n\n\u5f53\u67e5\u8be2\u4e3a\u7b2c1\u9875\u65f6\uff0cresult['total'] \u4e3a\u76f8\u5173\u7ed3\u679c\u6570:\n\nstatus,result=ysmtool.haosou.search('site:www.yesiming.com',1)\nif status==200 and result:\n print result['total'] #\u6536\u5f55\u6570\n\naizhan\u6a21\u5757\n===========\n\n\u6253\u5370\u51fa\u6700\u8fd1\u534a\u5e74\u6dd8\u5b9d\u5728\u767e\u5ea6\u7684\u6536\u5f55\u60c5\u51b5\nysmtool.aizhan.history(\"www.taobao.com\",'baidu')\n\n\u8fd4\u56de\u6dd8\u5b9d\u6700\u8fd1\u534a\u5e74\u7684\u5386\u53f2\u6570\u636e\uff0c\u5305\u62ec\u767e\u5ea6\u6536\u5f55\uff0c\u767e\u5ea6\u7d22\u5f15\uff0c\u767e\u5ea6\u53cd\u94fe\uff0c360\u6536\u5f55\uff0c360\u53cd\u94fe\uff0c\u641c\u72d7\u6536\u5f55\uff0c\u641c\u72d7\u53cd\u94fe, Json\u683c\u5f0f\n\njson=ysmtool.aizhan.history('www.taobao.com')\nif json:\n print json\n\n\u8054\u7cfb\u6211\n==========\n\n\u6709\u95ee\u9898\u8bf7\u53d1\u90ae\u7bb1\u81f3 simon@yesiming.com\n\u6216\u8005QQ: 176089710\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://www.yesiming.com", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "ysmtool", "package_url": "https://pypi.org/project/ysmtool/", "platform": "", "project_url": "https://pypi.org/project/ysmtool/", "project_urls": { "Homepage": "http://www.yesiming.com" }, "release_url": "https://pypi.org/project/ysmtool/0.9/", "requires_dist": null, "requires_python": "", "summary": "\u4e2a\u4eba\u5de5\u5177\u5e93\uff0c\u4e3b\u8981\u7528\u4e8eSEO\uff0c\u6570\u636e\u91c7\u96c6\u65b9\u9762", "version": "0.9" }, "last_serial": 3780382, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "1fb3b6c375066bf5ee2717687b3697a4", "sha256": "002705920350bfce6efcda4e260eb55b13c60adf50fe45bd28f8eab389764401" }, "downloads": -1, "filename": "ysmtool-0.1.tar.gz", "has_sig": false, "md5_digest": "1fb3b6c375066bf5ee2717687b3697a4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2680, "upload_time": "2018-04-09T05:52:27", "url": "https://files.pythonhosted.org/packages/a1/0b/c4e02e30eb72a6b096c73167c34932ae7bd90b5eedeccff5c022a8a883ab/ysmtool-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "011e794e769ee09e155b25223e6ed125", "sha256": "8e2e9d638090635281723056bb145a0875cbc522d768e420cd1207426b4a9204" }, "downloads": -1, "filename": "ysmtool-0.2.tar.gz", "has_sig": false, "md5_digest": "011e794e769ee09e155b25223e6ed125", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3417, "upload_time": "2018-04-09T12:08:07", "url": "https://files.pythonhosted.org/packages/07/49/9b53dac14a31ad9b55fe4b66a6031a0d88a892db0a3f15f8ef23b7a87d1c/ysmtool-0.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "e7e918b283d263f7e2a403920bce1dd0", "sha256": "fa956fed330574f0bbaa1cfddcca7de69e60453b191a706ded0d1eaf0f919425" }, "downloads": -1, "filename": "ysmtool-0.3.tar.gz", "has_sig": false, "md5_digest": "e7e918b283d263f7e2a403920bce1dd0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3607, "upload_time": "2018-04-09T12:26:36", "url": "https://files.pythonhosted.org/packages/b7/2c/ade512a289f7bedb11df539775dca27922e7c1ac432335a78abc4dd0f612/ysmtool-0.3.tar.gz" } ], "0.4": [ { "comment_text": "", "digests": { "md5": "b88092b056fad3fcbbe86e60aa9eca8a", "sha256": "a4a9781116671666aba29396e6ab49a8a4cad1381d68b1ca0eb7367db9cbbdb9" }, "downloads": -1, "filename": "ysmtool-0.4.tar.gz", "has_sig": false, "md5_digest": "b88092b056fad3fcbbe86e60aa9eca8a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5121, "upload_time": "2018-04-11T12:02:39", "url": "https://files.pythonhosted.org/packages/b2/f6/23808425d347111332cb85c961c786cc6e9851f20c768f242d58b063192d/ysmtool-0.4.tar.gz" } ], "0.5": [ { "comment_text": "", "digests": { "md5": "abd94499e0aded00aa654cb958ba248a", "sha256": "80fef5dea6b4e065e82657f430bbff66e96fc990086d4efa76fbd2979fbdab31" }, "downloads": -1, "filename": "ysmtool-0.5.tar.gz", "has_sig": false, "md5_digest": "abd94499e0aded00aa654cb958ba248a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5722, "upload_time": "2018-04-12T01:41:35", "url": "https://files.pythonhosted.org/packages/65/55/79b1fbc78e0570f5bb43be3ae60c61bcad11b5c2c55a3799c7d4548b89c7/ysmtool-0.5.tar.gz" } ], "0.6": [ { "comment_text": "", "digests": { "md5": "a513b364b9b9f08609eea3a579346cbc", "sha256": "d1b6c3146236e725a519702dbf6c1459e08ecd58708ca24c4602482a392c1954" }, "downloads": -1, "filename": "ysmtool-0.6.tar.gz", "has_sig": false, "md5_digest": "a513b364b9b9f08609eea3a579346cbc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6935, "upload_time": "2018-04-12T12:49:10", "url": "https://files.pythonhosted.org/packages/e4/5e/361b4e9fb81d06d9472ff2c66c1a32df21e2c88a9be644c3099f2c7730ef/ysmtool-0.6.tar.gz" } ], "0.7": [ { "comment_text": "", "digests": { "md5": "c36e4cf7978f0f8fb0136e1b5ee55083", "sha256": "e89f795c3c893c653a8c8b361abf5245537bd85ff31aecb162a13ad388828a94" }, "downloads": -1, "filename": "ysmtool-0.7.tar.gz", "has_sig": false, "md5_digest": "c36e4cf7978f0f8fb0136e1b5ee55083", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6940, "upload_time": "2018-04-12T12:52:13", "url": "https://files.pythonhosted.org/packages/68/6b/a0407bb63ab3cd9ff9bae4313039c956a01b65feaa97a7b51afe375db320/ysmtool-0.7.tar.gz" } ], "0.8": [ { "comment_text": "", "digests": { "md5": "273d768a523b9a5ef75897c1e50ad00e", "sha256": "889781e235893be73831f525c2f9d064ffd1a1a2aa1308b1d3003d68bcf8dec2" }, "downloads": -1, "filename": "ysmtool-0.8.tar.gz", "has_sig": false, "md5_digest": "273d768a523b9a5ef75897c1e50ad00e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7108, "upload_time": "2018-04-19T06:08:01", "url": "https://files.pythonhosted.org/packages/45/d6/5e94363e3ce82166a15ef811ee5237370be8ec284c9b8de325aa28eb53b8/ysmtool-0.8.tar.gz" } ], "0.9": [ { "comment_text": "", "digests": { "md5": "112a8971a8e24e312661556c07f736b4", "sha256": "a39629e64fb0b6d94e7fd39534169cd64b46d865ad8eaa455a0ce6ae4c04b587" }, "downloads": -1, "filename": "ysmtool-0.9.tar.gz", "has_sig": false, "md5_digest": "112a8971a8e24e312661556c07f736b4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6878, "upload_time": "2018-04-19T12:04:58", "url": "https://files.pythonhosted.org/packages/12/54/ebe8458ff12842324f250bd412b45f549c1ce667b739f75c34b636ea3f58/ysmtool-0.9.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "112a8971a8e24e312661556c07f736b4", "sha256": "a39629e64fb0b6d94e7fd39534169cd64b46d865ad8eaa455a0ce6ae4c04b587" }, "downloads": -1, "filename": "ysmtool-0.9.tar.gz", "has_sig": false, "md5_digest": "112a8971a8e24e312661556c07f736b4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6878, "upload_time": "2018-04-19T12:04:58", "url": "https://files.pythonhosted.org/packages/12/54/ebe8458ff12842324f250bd412b45f549c1ce667b739f75c34b636ea3f58/ysmtool-0.9.tar.gz" } ] }