{ "info": { "author": "Ijaz Ur Rahim", "author_email": "ijazkhan095@gmail.com", "bugtrack_url": null, "classifiers": [ "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3" ], "description": "[![PyPi version](https://img.shields.io/pypi/v/bs2json.svg)](https://pypi.python.org/pypi/bs2json/)\n[![PyPi pyversions](https://img.shields.io/pypi/pyversions/bs2json.svg)](https://pypi.python.org/pypi/bs2json/)\n[![PyPi license](https://img.shields.io/pypi/l/bs2json.svg)](https://pypi.python.org/pypi/bs2json/)\n\nConvert HTML Tags of BeautifulSoup class to JSON data using.\n\nInstallation\n----\n\nThis package is available on PyPi. Just use `pip install -U bs2json` to install it. Then you can import it using `from bs2json import bs2json`.\n\nExample Syntax\n----\n\n```python3\nfrom bs4 import BeautifulSoup\nfrom requests import get\nfrom bs2json import bs2json\n\nhtml = get('https://ijazurrahim.com').text\n\nsoup = BeautifulSoup(html,'lxml')\nconverter = bs2json()\n\ntag = soup.find('ul')\njson = converter.convert(tag)\nprint(json)\n```\n\nOutput\n----\n\nUpon running the Above Program, you will get the following output\n\n```python3\n{'ul': {'attributes': {'class': ['nav', 'nav-justified', 'justify-content-center']}, 'li': [{'attributes': {'class': ['nav-item'], 'onclick': \"window.location='#home';change();\"}, 'a': {'attributes': {'href': '#home'}, 'text': 'Home'}, 'text': ''}, {'attributes': {'class': ['nav-item'], 'onclick': \"window.location='#skills';change();\"}, 'a': {'attributes': {'href': '#skills'}, 'text': 'Skills'}, 'text': ''}, {'attributes': {'class': ['nav-item'], 'onclick': \"window.location='#contact';change();\"}, 'a': {'attributes': {'href': '#contact'}, 'text': 'Contact'}, 'text': ''}, {'attributes': {'class': ['nav-item'], 'onclick': \"window.location='#blog';change();\"}, 'a': {'attributes': {'href': '#blog'}, 'text': 'Blog'}, 'text': ''}], 'text': ''}}\n```\n\nOther Methods\n----\n\n- There are total 2 methods `convert()` and `convertAll()` which takes two parameters of type `bs4.element.Tag`, `dict` and `bs4.ResultSet`, `list` respectively. \n- `convert()` method takes `bs4.element.Tag` and `dict` as arguments. `bs4.element.Tag` is result of `soup.find()` and `dict` is an empty dictionary or already constructed dictionary.\n- `convertAll()` also method takes `bs4.ResultSet` and `list` as arguments. `bs4.ResultSet` is result of `soup.findAll()` and `list` is an empty list or already constructed list.\n\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/MrDebugger/bs2json", "keywords": "parser,html,bs4,json", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "bs2json", "package_url": "https://pypi.org/project/bs2json/", "platform": "", "project_url": "https://pypi.org/project/bs2json/", "project_urls": { "Homepage": "https://github.com/MrDebugger/bs2json" }, "release_url": "https://pypi.org/project/bs2json/0.0.0.2/", "requires_dist": [ "bs4 (>=0.0.1)" ], "requires_python": "", "summary": "Convert bs4 Tags into Json", "version": "0.0.0.2" }, "last_serial": 5960925, "releases": { "0.0.0.1": [ { "comment_text": "", "digests": { "md5": "cbb1676feeb10e46772df136cd35e99b", "sha256": "e209e749b76708253a62e3c6be9a91f5518b421f172db63ab43d19ffe5c991cb" }, "downloads": -1, "filename": "bs2json-0.0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "cbb1676feeb10e46772df136cd35e99b", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 3018, "upload_time": "2019-10-11T14:48:12", "url": "https://files.pythonhosted.org/packages/32/54/552b3d08201591f390aef5c3102917a415781c2455f4a762c4219430093e/bs2json-0.0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3b754060342ef148abd94fca72dd4199", "sha256": "30b40122b247858a8da33ffea79e5e38589e3924df21a1c690c2cc87dfb055ee" }, "downloads": -1, "filename": "bs2json-0.0.0.1.tar.gz", "has_sig": false, "md5_digest": "3b754060342ef148abd94fca72dd4199", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1740, "upload_time": "2019-10-11T14:48:16", "url": "https://files.pythonhosted.org/packages/b9/b6/ff9d9a09deb066bd7556b7734fe64d3084941116835fdd0313e7c80832b7/bs2json-0.0.0.1.tar.gz" } ], "0.0.0.2": [ { "comment_text": "", "digests": { "md5": "def5cb0587d2f96fea4aef43970d6720", "sha256": "1bd8e4678fb3bc50fbcb4faace592a9cdfff8f1656d64d67cd86373693caa1d1" }, "downloads": -1, "filename": "bs2json-0.0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "def5cb0587d2f96fea4aef43970d6720", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 3739, "upload_time": "2019-10-11T15:41:23", "url": "https://files.pythonhosted.org/packages/dc/e3/7d228e0789bc9c05350c7310351bbe851d2fa71e0ba3e28a05afa848c885/bs2json-0.0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "80a9e77d77e32e4bcd4bb7ab67a68d10", "sha256": "02951486444e6182b513df7ad4e8112ac2ef1a2363f2d1f76832a54b03d51b1f" }, "downloads": -1, "filename": "bs2json-0.0.0.2.tar.gz", "has_sig": false, "md5_digest": "80a9e77d77e32e4bcd4bb7ab67a68d10", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2608, "upload_time": "2019-10-11T15:41:24", "url": "https://files.pythonhosted.org/packages/c3/9e/06d28e66bb44ff122e88144b0657ee016a6b4b556166076814750057a31f/bs2json-0.0.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "def5cb0587d2f96fea4aef43970d6720", "sha256": "1bd8e4678fb3bc50fbcb4faace592a9cdfff8f1656d64d67cd86373693caa1d1" }, "downloads": -1, "filename": "bs2json-0.0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "def5cb0587d2f96fea4aef43970d6720", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 3739, "upload_time": "2019-10-11T15:41:23", "url": "https://files.pythonhosted.org/packages/dc/e3/7d228e0789bc9c05350c7310351bbe851d2fa71e0ba3e28a05afa848c885/bs2json-0.0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "80a9e77d77e32e4bcd4bb7ab67a68d10", "sha256": "02951486444e6182b513df7ad4e8112ac2ef1a2363f2d1f76832a54b03d51b1f" }, "downloads": -1, "filename": "bs2json-0.0.0.2.tar.gz", "has_sig": false, "md5_digest": "80a9e77d77e32e4bcd4bb7ab67a68d10", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2608, "upload_time": "2019-10-11T15:41:24", "url": "https://files.pythonhosted.org/packages/c3/9e/06d28e66bb44ff122e88144b0657ee016a6b4b556166076814750057a31f/bs2json-0.0.0.2.tar.gz" } ] }