{ "info": { "author": "Sagar Nilesh Shah", "author_email": "shah.sagar.nilesh@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 2.7" ], "description": "autobrowser: Toolset for automated browsing\n===========================================\n\nautobrowser aims to provide tools, with the help of 3rd party modules, to allow users to browse the web programmatically using a web browser.\nIt particularly helps to identify and access content from websites that do not have APIs.\n\n\nDependencies\n------------\n\n- Web browser (preferably Firefox)\n- Python 2.7\n- Tornado\n- Selenium\n\n\nFeatures\n--------\n\n- **Probe**:\n to help identify HTML elements and their exact css location in the DOM tree by user mousedown event on the HTML element in the web browser.\n The HTML elements identified will have a certain attribute set and this attribute set will be saved in the provided file, separated by the caret character ( ^ )\n\n- **execution loop**:\n accepts a user function and can run it repeatedly in, either single-threaded sequential manner or multi-process periodical manner\n\n\nInstallation\n------------\n\n.. code-block:: bash\n\n $ pip install autobrowser\n\nUsage\n-----\n\n\n- **For probing HTML elements in web browser**\n\n\n - *Please ensure to only use the default active tab in the invoked browser for probing.*\n - *Please let the browser completely load the webpage before starting to probe.*\n\n.. code-block:: python\n\n from selenium import webdriver\n from autobrowser import probe\n\n wd = webdriver.Firefox()\n\n probe.Probe(wd, , , ).start()\n\n\n*Example output*\n\n.. code-block:: bash\n\n event^datetime^elem_location^elem_id^elem_tagName^elem_className^elem_innerHTML^css_location\n mousedown^2015-01-01T12:41:00.691Z^www.google.com.hk/^lst-ib^INPUT^gsfi lst-d-f^^BODY>DIV:nth-child(1)>DIV:nth-child(5)>FORM:nth-child(3)>DIV:nth-child(2)>DIV:nth-child(2)>DIV:nth-child(1)>DIV:nth-child(1)>DIV:nth-child(1)>DIV:nth-child(1)>DIV:nth-child(2)>DIV:nth-child(1)>INPUT:nth-child(1)\n mousedown^2015-01-01T12:41:05.202Z^www.google.com.hk/^^INPUT^^^BODY>DIV:nth-child(1)>DIV:nth-child(5)>FORM:nth-child(3)>DIV:nth-child(2)>DIV:nth-child(3)>CENTER:nth-child(1)>INPUT:nth-child(1)\n mousedown^2015-01-01T12:41:09.108Z^www.google.com.hk/^^A^^Giant panda - Wikipedia, the free encyclopedia^BODY>DIV:nth-child(1)>DIV:nth-child(7)>DIV:nth-child(3)>DIV:nth-child(7)>DIV:nth-child(2)>DIV:nth-child(3)>DIV:nth-child(1)>DIV:nth-child(2)>DIV:nth-child(2)>DIV:nth-child(2)>DIV:nth-child(2)>OL:nth-child(1)>DIV:nth-child(6)>LI:nth-child(1)>DIV:nth-child(1)>H3:nth-child(1)>A:nth-child(1)\n mousedown^2015-01-01T12:41:13.397Z^en.wikipedia.org/wiki/Giant_panda^^SPAN^^Giant panda^BODY>DIV:nth-child(3)>H1:nth-child(4)>SPAN:nth-child(1)\n\n\n- **For running a function in the execution loop**\n\n.. code-block:: python\n\n from autobrowser import utility\n from selenium import webdriver\n from selenium.webdriver.common.keys import Keys\n\n wd = webdriver.Firefox()\n\n def foo():\n wd.get(\"http://google.com\")\n\n # you can use the css_location retrieved from the autobrowser Probe in the css selector\n elem = wd.find_element_by_css_selector(\"BODY>DIV:nth-child(1)>DIV:nth-child(5)>FORM:nth-child(3)>DIV:nth-child(2)>DIV:nth-child(2)>DIV:nth-child(1)>DIV:nth-child(1)>DIV:nth-child(1)>DIV:nth-child(1)>DIV:nth-child(2)>DIV:nth-child(1)>INPUT:nth-child(1)\")\n\n elem.send_keys(\"cricket\")\n elem.send_keys(Keys.RETURN)\n\n # For running repeatedly in sequential manner with '60' seconds delay\n utility.FunctionRunner(foo).repeat_sequential(60)\n\n # For running repeatedly in periodic manner every '15' seconds\n # with 5 processes\n #\n # utility.FunctionRunner(foo).repeat_periodic(15, 5)\n\n\nLicense\n-------\n\nThe MIT License\n\nCopyright (c) 2014 Sagar Nilesh Shah\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.", "description_content_type": null, "docs_url": null, "download_url": null, "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/sgzsh269/autobrowser", "keywords": "automation web browser", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "autobrowser", "package_url": "https://pypi.org/project/autobrowser/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/autobrowser/", "project_urls": { "Homepage": "https://github.com/sgzsh269/autobrowser" }, "release_url": "https://pypi.org/project/autobrowser/0.2.0/", "requires_dist": null, "requires_python": null, "summary": "Toolset for automated browsing", "version": "0.2.0" }, "last_serial": 1390259, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "9635817e2c4d68a52f30ce35fd18b20d", "sha256": "fe330e615cc460a958591b69bc9f2f073575464159c601a40aa3eb55a7c6885c" }, "downloads": -1, "filename": "autobrowser-0.1.0.tar.gz", "has_sig": false, "md5_digest": "9635817e2c4d68a52f30ce35fd18b20d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5707, "upload_time": "2015-01-02T15:41:11", "url": "https://files.pythonhosted.org/packages/30/18/358b1d3b4fdf694d8d58e1e8d4e52b06bcbc901ae22c84eb3b33264141d1/autobrowser-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "b454b5ef73045cf8e3e3e5f8a7debd30", "sha256": "678257d00eba51d84cfad8ab881d32d9b773f017438cd3d0c8693878eaebf376" }, "downloads": -1, "filename": "autobrowser-0.1.1.tar.gz", "has_sig": false, "md5_digest": "b454b5ef73045cf8e3e3e5f8a7debd30", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5732, "upload_time": "2015-01-03T03:47:39", "url": "https://files.pythonhosted.org/packages/46/25/4dfaeb1c2b20017265681682606aea00180e0f08220be3b714f847448646/autobrowser-0.1.1.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "ced347c747ee1963f4b34258b9f0a984", "sha256": "4dd9ee5c885684c6a3a960ac47e04f34288b6ab56a5ebacb544bcc07e6ce40ce" }, "downloads": -1, "filename": "autobrowser-0.2.0.tar.gz", "has_sig": false, "md5_digest": "ced347c747ee1963f4b34258b9f0a984", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5581, "upload_time": "2015-01-21T08:19:59", "url": "https://files.pythonhosted.org/packages/9c/ba/53592722f35b529a08dc355ee52b1baa6af040f905189db1f6694a77cf56/autobrowser-0.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ced347c747ee1963f4b34258b9f0a984", "sha256": "4dd9ee5c885684c6a3a960ac47e04f34288b6ab56a5ebacb544bcc07e6ce40ce" }, "downloads": -1, "filename": "autobrowser-0.2.0.tar.gz", "has_sig": false, "md5_digest": "ced347c747ee1963f4b34258b9f0a984", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5581, "upload_time": "2015-01-21T08:19:59", "url": "https://files.pythonhosted.org/packages/9c/ba/53592722f35b529a08dc355ee52b1baa6af040f905189db1f6694a77cf56/autobrowser-0.2.0.tar.gz" } ] }