{ "info": { "author": "fate0", "author_email": "fate0@fatezero.org", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Natural Language :: English", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: Browsers" ], "description": "# pychrome\n\n[![Build Status](https://travis-ci.org/fate0/pychrome.svg?branch=master)](https://travis-ci.org/fate0/pychrome)\n[![Codecov](https://img.shields.io/codecov/c/github/fate0/pychrome.svg)](https://codecov.io/gh/fate0/pychrome)\n[![Updates](https://pyup.io/repos/github/fate0/pychrome/shield.svg)](https://pyup.io/repos/github/fate0/pychrome/)\n[![PyPI](https://img.shields.io/pypi/v/pychrome.svg)](https://pypi.python.org/pypi/pychrome)\n[![PyPI](https://img.shields.io/pypi/pyversions/pychrome.svg)](https://github.com/fate0/pychrome)\n\nA Python Package for the Google Chrome Dev Protocol, [more document](https://fate0.github.io/pychrome/)\n\n## Table of Contents\n\n* [Installation](#installation)\n* [Setup Chrome](#setup-chrome)\n* [Getting Started](#getting-started)\n* [Tab management](#tab-management)\n* [Debug](#debug)\n* [Examples](#examples)\n* [Ref](#ref)\n\n\n## Installation\n\nTo install pychrome, simply:\n\n```\n$ pip install -U pychrome\n```\n\nor from GitHub:\n\n```\n$ pip install -U git+https://github.com/fate0/pychrome.git\n```\n\nor from source:\n\n```\n$ python setup.py install\n```\n\n## Setup Chrome\n\nsimply:\n\n```\n$ google-chrome --remote-debugging-port=9222\n```\n\nor headless mode (chrome version >= 59):\n\n```\n$ google-chrome --headless --disable-gpu --remote-debugging-port=9222\n```\n\nor use docker:\n\n```\n$ docker pull fate0/headless-chrome\n$ docker run -it --rm --cap-add=SYS_ADMIN -p9222:9222 fate0/headless-chrome\n```\n\n## Getting Started\n\n``` python\nimport pychrome\n\n# create a browser instance\nbrowser = pychrome.Browser(url=\"http://127.0.0.1:9222\")\n\n# create a tab\ntab = browser.new_tab()\n\n# register callback if you want\ndef request_will_be_sent(**kwargs):\n print(\"loading: %s\" % kwargs.get('request').get('url'))\n\ntab.Network.requestWillBeSent = request_will_be_sent\n\n# start the tab \ntab.start()\n\n# call method\ntab.Network.enable()\n# call method with timeout\ntab.Page.navigate(url=\"https://github.com/fate0/pychrome\", _timeout=5)\n\n# wait for loading\ntab.wait(5)\n\n# stop the tab (stop handle events and stop recv message from chrome)\ntab.stop()\n\n# close tab\nbrowser.close_tab(tab)\n\n```\n\nor (alternate syntax)\n\n``` python\nimport pychrome\n\nbrowser = pychrome.Browser(url=\"http://127.0.0.1:9222\")\ntab = browser.new_tab()\n\ndef request_will_be_sent(**kwargs):\n print(\"loading: %s\" % kwargs.get('request').get('url'))\n\n\ntab.set_listener(\"Network.requestWillBeSent\", request_will_be_sent)\n\ntab.start()\ntab.call_method(\"Network.enable\")\ntab.call_method(\"Page.navigate\", url=\"https://github.com/fate0/pychrome\", _timeout=5)\n\ntab.wait(5)\ntab.stop()\n\nbrowser.close_tab(tab)\n```\n\nmore methods or events could be found in\n[Chrome DevTools Protocol](https://chromedevtools.github.io/devtools-protocol/tot/)\n\n\n## Debug\n\nset DEBUG env variable:\n\n![pychrome_with_debug_env](https://raw.githubusercontent.com/fate0/pychrome/master/docs/images/pychrome_with_debug_env.png)\n\n\n## Tab management\n\nrun `pychrome -h` for more info\n\nexample:\n\n![pychrome_tab_management](https://raw.githubusercontent.com/fate0/pychrome/master/docs/images/pychrome_tab_management.png)\n\n\n## Examples\n\nplease see the [examples](http://github.com/fate0/pychrome/blob/master/examples) directory for more examples\n\n\n## Ref\n\n* [chrome-remote-interface](https://github.com/cyrus-and/chrome-remote-interface/)\n* [Chrome DevTools Protocol](https://chromedevtools.github.io/devtools-protocol/tot/)", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/fate0/pychrome", "keywords": "pychrome", "license": "BSD license", "maintainer": "", "maintainer_email": "", "name": "pychrome", "package_url": "https://pypi.org/project/pychrome/", "platform": "", "project_url": "https://pypi.org/project/pychrome/", "project_urls": { "Homepage": "https://github.com/fate0/pychrome" }, "release_url": "https://pypi.org/project/pychrome/0.2.3/", "requires_dist": null, "requires_python": "", "summary": "A Python Package for the Google Chrome Dev Protocol", "version": "0.2.3" }, "last_serial": 5238565, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "66e71a65f5226388c5cfc3f62c14d14e", "sha256": "7d581d3e932a6e2cd8369ff49aa74c4502d81066f056876247fec4e3e8dd45f0" }, "downloads": -1, "filename": "pychrome-0.0.1.tar.gz", "has_sig": false, "md5_digest": "66e71a65f5226388c5cfc3f62c14d14e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2811, "upload_time": "2017-07-26T15:39:19", "url": "https://files.pythonhosted.org/packages/b9/f6/eef42419d567e4ca45cd4cd4aacaa3d710e3e3258c4d8e931048ddd42d1c/pychrome-0.0.1.tar.gz" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "2eea2ed49f004dbb55fe68c59c2db779", "sha256": "05503981f45a43ae8347917b2bfeac91fd08a6ca9f72aea23f668fd192212a88" }, "downloads": -1, "filename": "pychrome-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "2eea2ed49f004dbb55fe68c59c2db779", "packagetype": "bdist_wheel", "python_version": "3.5", "requires_python": null, "size": 9499, "upload_time": "2017-08-02T16:43:15", "url": "https://files.pythonhosted.org/packages/b3/d8/4e965c6098c68af491f80588cb9d41f4982521fe88e1c1f39c1935c95ab3/pychrome-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "294937673b6b3e52584014554861acac", "sha256": "4e989dd505ff8b01d3659efed089cfd420b7b14a69c337949dc4b69bc2ba1f5d" }, "downloads": -1, "filename": "pychrome-0.1.0.tar.gz", "has_sig": false, "md5_digest": "294937673b6b3e52584014554861acac", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9567, "upload_time": "2017-08-02T16:43:11", "url": "https://files.pythonhosted.org/packages/ce/bc/321c2c5a0a090a552062361cb9c910a49bc8ddfdfb9c9068e3e7a9e7968a/pychrome-0.1.0.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "1c0ecfbe7aa0db75c1743ec44ad6769b", "sha256": "c9120c46778dcb57bc7253414c70c506a82dd77b68ad9f229b9d9e8d9475ee9e" }, "downloads": -1, "filename": "pychrome-0.2.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "1c0ecfbe7aa0db75c1743ec44ad6769b", "packagetype": "bdist_wheel", "python_version": "3.5", "requires_python": null, "size": 9453, "upload_time": "2017-08-28T11:23:37", "url": "https://files.pythonhosted.org/packages/52/6e/67fc70a9907bef3d6339a3ab333f2436b9e0a34711df4bcc4023429aa4f4/pychrome-0.2.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "aada8cf42bc16ff176e5414b3775796e", "sha256": "4e1c6d24583f6e2987f3323873ea8c30102f5d53939056bd92a14f96347e5eb7" }, "downloads": -1, "filename": "pychrome-0.2.0.tar.gz", "has_sig": false, "md5_digest": "aada8cf42bc16ff176e5414b3775796e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9781, "upload_time": "2017-08-28T11:23:33", "url": "https://files.pythonhosted.org/packages/f5/81/c6eb8165c2d1aeb127861fd8f6aa1533fddc32b32c8bd33a7a2397009a00/pychrome-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "914c478f96e9248e2d0de5cbcb445494", "sha256": "4d89ba532f3582ff4a11c7128977804d69fcf66b4809eafaefdbb305a36beaef" }, "downloads": -1, "filename": "pychrome-0.2.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "914c478f96e9248e2d0de5cbcb445494", "packagetype": "bdist_wheel", "python_version": "3.5", "requires_python": null, "size": 9330, "upload_time": "2017-09-01T11:53:02", "url": "https://files.pythonhosted.org/packages/18/91/a4130a57f1a8a28f0925befffb91040b7a5d5d4083f91f1bf81f65e6227f/pychrome-0.2.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "624e7702bbfbebd1c59345b4f52ee04b", "sha256": "012db932f3bfaad1b246b0289b6db29f1ae51f055bcef50f2ceb3aea3604a328" }, "downloads": -1, "filename": "pychrome-0.2.1.tar.gz", "has_sig": false, "md5_digest": "624e7702bbfbebd1c59345b4f52ee04b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9696, "upload_time": "2017-09-01T11:52:58", "url": "https://files.pythonhosted.org/packages/ab/d5/fdec25bd1772de837a34fd4dcaa44d677eeea01513267f9960532dee44d2/pychrome-0.2.1.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "49e2adb92d3e959be8328cbf564afb30", "sha256": "7d8a3e8a3e1a37ddf70cde0de6896607540610c20c5a38d90d4377aaec3444ec" }, "downloads": -1, "filename": "pychrome-0.2.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "49e2adb92d3e959be8328cbf564afb30", "packagetype": "bdist_wheel", "python_version": "3.5", "requires_python": null, "size": 9360, "upload_time": "2017-12-25T12:38:28", "url": "https://files.pythonhosted.org/packages/bb/1a/a2dd6368b7c4f572d6f56b03f379cda10c0ccec9f8a97b5d24269b32a584/pychrome-0.2.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "fb9b2c2e7a28de410a9a69e1ad5e2ec1", "sha256": "b9d6df48d3b4fe31d1cf4a3f8461035c6beb1e4f57c777059195824acfd4cb9b" }, "downloads": -1, "filename": "pychrome-0.2.2.tar.gz", "has_sig": false, "md5_digest": "fb9b2c2e7a28de410a9a69e1ad5e2ec1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9711, "upload_time": "2017-12-25T12:38:25", "url": "https://files.pythonhosted.org/packages/d2/38/9a71c63eebfee8e9e133f9a3ae648fd88b082504c5ef09e0a1bc462742b7/pychrome-0.2.2.tar.gz" } ], "0.2.3": [ { "comment_text": "", "digests": { "md5": "17fb977b2dc8bd636dd24c0b20bbc35b", "sha256": "dc4f788a9e1495276b0380988af1988e32aba74d727b1f7d22a25b9db7229b56" }, "downloads": -1, "filename": "pychrome-0.2.3.tar.gz", "has_sig": false, "md5_digest": "17fb977b2dc8bd636dd24c0b20bbc35b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10597, "upload_time": "2019-05-07T14:43:13", "url": "https://files.pythonhosted.org/packages/2e/9a/ec42df3a2712e70442f4a98cb67c01bdcc3f6be6bd8f25362bec39f85673/pychrome-0.2.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "17fb977b2dc8bd636dd24c0b20bbc35b", "sha256": "dc4f788a9e1495276b0380988af1988e32aba74d727b1f7d22a25b9db7229b56" }, "downloads": -1, "filename": "pychrome-0.2.3.tar.gz", "has_sig": false, "md5_digest": "17fb977b2dc8bd636dd24c0b20bbc35b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10597, "upload_time": "2019-05-07T14:43:13", "url": "https://files.pythonhosted.org/packages/2e/9a/ec42df3a2712e70442f4a98cb67c01bdcc3f6be6bd8f25362bec39f85673/pychrome-0.2.3.tar.gz" } ] }