{ "info": { "author": "Joshua Carp", "author_email": "jm.carp@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Natural Language :: English", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3" ], "description": "PyRobot: Your friendly neighborhood web scraper\n===============================================\n\n.. image:: https://badge.fury.io/py/pyrobot.png\n :target: http://badge.fury.io/py/pyrobot\n \n.. image:: https://travis-ci.org/jmcarp/pyrobot.png?branch=master\n :target: https://travis-ci.org/jmcarp/pyrobot\n\n.. image:: https://coveralls.io/repos/jmcarp/pyrobot/badge.png?branch=master\n :target: https://coveralls.io/r/jmcarp/pyrobot\n\nHomepage: `http://pyrobot.readthedocs.org/ `_\n\n.. code-block:: python\n \n import re\n from pyrobot import RoboBrowser\n \n # Browse to Rap Genius\n browser = RoboBrowser(history=True)\n browser.open('http://rapgenius.com/')\n \n # Search for Queen\n form = browser.get_form(action=re.compile(r'search'))\n form['q'].value = 'queen'\n browser.submit_form(form)\n\n # Look up the first song\n songs = browser.select('.song_name')\n browser.follow_link(songs[0])\n lyrics = browser.find(class_=re.compile(r'\\blyrics\\b'))\n lyrics.text # \\n[Intro]\\nIs this the real life...\n \n # Back to results page\n browser.back()\n\n # Look up my favorite song\n browser.follow_link('death on two legs')\n lyrics = browser.find(class_=re.compile(r'\\blyrics\\b'))\n lyrics.text # \\n[Verse 1]\\nYou suck my blood like a leech...\n\nPyRobot combines the best of two excellent Python libraries: \nRequests and BeautifulSoup. PyRobot represents browser sessions using\nRequests and HTML responses using BeautifulSoup, transparently exposing \nmethods of both libraries:\n\n.. code-block:: python\n\n import re\n from pyrobot import RoboBrowser\n\n browser = RoboBrowser(user_agent='a python robot')\n browser.open('https://github.com/')\n\n # Inspect the browser session\n browser.session.cookies['_gh_sess'] # BAh7Bzo...\n browser.session.headers['User-Agent'] # a python robot\n\n # Searched the parsed HTML\n browser.select('div.teaser-icon') # [
\n # \n #
,\n # ...\n browser.find(class_=re.compile(r'column', re.I)) #
\n #
\n # \n # ...\n\n", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/jmcarp/pyrobot", "keywords": "pyrobot", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "pyrobot", "package_url": "https://pypi.org/project/pyrobot/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/pyrobot/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/jmcarp/pyrobot" }, "release_url": "https://pypi.org/project/pyrobot/0.1.0/", "requires_dist": null, "requires_python": null, "summary": "Your friendly neighborhood web scraper", "version": "0.1.0" }, "last_serial": 993949, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "d5b9f52a79752c495eeae2e46b4c255d", "sha256": "9f0abbbf665c6187e7739d4cebc3bf6bebea103dc08c7f1800e1784ad0d35243" }, "downloads": -1, "filename": "pyrobot-0.1.0.tar.gz", "has_sig": false, "md5_digest": "d5b9f52a79752c495eeae2e46b4c255d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10944, "upload_time": "2014-02-07T22:49:50", "url": "https://files.pythonhosted.org/packages/25/b9/80d4869915307feb8e749b24e3c9329184101561a8b5ada07fd7cc7ba08c/pyrobot-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d5b9f52a79752c495eeae2e46b4c255d", "sha256": "9f0abbbf665c6187e7739d4cebc3bf6bebea103dc08c7f1800e1784ad0d35243" }, "downloads": -1, "filename": "pyrobot-0.1.0.tar.gz", "has_sig": false, "md5_digest": "d5b9f52a79752c495eeae2e46b4c255d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10944, "upload_time": "2014-02-07T22:49:50", "url": "https://files.pythonhosted.org/packages/25/b9/80d4869915307feb8e749b24e3c9329184101561a8b5ada07fd7cc7ba08c/pyrobot-0.1.0.tar.gz" } ] }