{"id":15070047,"url":"https://github.com/adregner/beautifulscraper","last_synced_at":"2025-10-19T05:32:51.146Z","repository":{"id":5286987,"uuid":"6466481","full_name":"adregner/beautifulscraper","owner":"adregner","description":"Python web-scraping library that wraps urllib2 and BeautifulSoup","archived":false,"fork":false,"pushed_at":"2019-09-22T15:49:17.000Z","size":18,"stargazers_count":39,"open_issues_count":0,"forks_count":15,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-06T19:43:56.389Z","etag":null,"topics":["beautifulsoup","cookie","python","python2","python3","urllib2"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/adregner.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-10-31T00:04:03.000Z","updated_at":"2024-08-12T19:21:37.000Z","dependencies_parsed_at":"2022-07-04T23:31:45.229Z","dependency_job_id":null,"html_url":"https://github.com/adregner/beautifulscraper","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adregner%2Fbeautifulscraper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adregner%2Fbeautifulscraper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adregner%2Fbeautifulscraper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adregner%2Fbeautifulscraper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adregner","download_url":"https://codeload.github.com/adregner/beautifulscraper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248261302,"owners_count":21074220,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["beautifulsoup","cookie","python","python2","python3","urllib2"],"created_at":"2024-09-25T01:46:44.053Z","updated_at":"2025-10-19T05:32:46.092Z","avatar_url":"https://github.com/adregner.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"BeautifulScraper\n----------------\n\nSimple wraper around [BeautifulSoup](http://www.crummy.com/software/BeautifulSoup/) for HTML parsing and urllib2 for HTTP(S) request/response handling.  BeautifulScraper also overrides some of the default handlers in [urllib2](http://docs.python.org/2/library/urllib2.html) in order to:\n  * Handle cookies properly\n  * Offer full control of included cookies\n  * Return the actual response from the server, un-mangled and not reprocessed\n\nInstallation\n------------\n\n    # pip install beautifulscraper\n\nor\n\n    # git clone git://github.com/adregner/beautifulscraper.git\n    # cd beautifulscraper/\n    # python setup.py install\n\nExamples\n--------\n\nGetting started is brain-dead simple.\n```python\n\u003e\u003e\u003e from beautifulscraper import BeautifulScraper\n\u003e\u003e\u003e scraper = BeautifulScraper()\n```\n\nStart by requesting something.\n```python\n\u003e\u003e\u003e body = scraper.go(\"https://github.com/adregner/beautifulscraper\")\n```\n\nThe response will be a plain BeautifulSoup object.  See [their documentation](http://www.crummy.com/software/BeautifulSoup/bs4/doc/) for how to use it.\n```python\n\u003e\u003e\u003e body.select(\".repository-meta-content\")[0].text\n'\\n\\n            Python web-scraping library that wraps urllib2 and BeautifulSoup\\n          \\n'\n```\n\nThe headers from the server's response are accessiable.\n```python\n\u003e\u003e\u003e for header, value in scraper.response_headers.items():\n...     print \"%s: %s\" % (header, value)\n...\nstatus: 200 OK\ncontent-length: 36179\nset-cookie: _gh_sess=BAh7BzoQX2NzcmZfdG9rZW4iMUNCOWxnbFpVd3EzOENqVk9GTUFXbDlMVUJIbGxsNEVZUFZJNiswRjhwejQ9Og9zZXNzaW9uX2lkIiUyNmQ2ODE5ZDdiZjM3MTA2N2VlZDk3Y2VlMDViYzI2OA%3D%3D--5d31df13d5c0eeb8f3cccb140392124968abc374; path=/; expires=Sat, 01-Jan-2022 00:00:00 GMT; secure; HttpOnly\nstrict-transport-security: max-age=2592000\nconnection: close\nserver: nginx\nx-runtime: 98\netag: \"1c595b5b6a25eb7f021e68c3476d61da\"\ncache-control: private, max-age=0, must-revalidate\ndate: Wed, 31 Oct 2012 02:14:08 GMT\nx-frame-options: deny\ncontent-type: text/html; charset=utf-8\n```\n\nSo is the response code as an integer.\n```python\n\u003e\u003e\u003e type(scraper.response_code), scraper.response_code\n(\u003ctype 'int'\u003e, 200)\n```\n\nThe scraper will keep track of all cookies it sees via the [cookielib.CookieJar class](http://docs.python.org/2/library/cookielib.html#cookiejar-and-filecookiejar-objects).  You can read the cookies if you'd like.  The [Cookie object](http://docs.python.org/2/library/cookielib.html#cookie-objects)'s are just a collection of properties.\n```python\n\u003e\u003e\u003e scraper.cookies[0].name\n'_gh_sess'\n```\n\nSee the pydoc for more information.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadregner%2Fbeautifulscraper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadregner%2Fbeautifulscraper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadregner%2Fbeautifulscraper/lists"}