Skip to content

JavaScript Dom Api for Python, Html Parser and a Web scraping tool in python

License

GPL-3.0, GPL-3.0 licenses found

Licenses found

GPL-3.0
LICENSE
GPL-3.0
LICENSE.txt
Notifications You must be signed in to change notification settings

Anikeshpatel/dompy

Repository files navigation

JavaScript Dom Api for Python, Html Parser and a Web scraping tool in python
Installation
pip install dompy-parser
Basic API
>>> from dompy import Document
>>> document = Document.fromURL('https://www.lipsum.com')
>>> document.title
'Lorem Ipsum - All the facts - Lipsum generator'
>>> elements = document.getElementsByTag('h3')
>>> len(elements)
5
>>> elements[0].innerHTML
'The standard Lorem Ipsum passage, used since the 1500s'

or

>>> from dompy import DompyParser
>>> document = DompyParser.parse('<div><h3 color="blue" align="center">Abc</h3><h3>Xyz</h3></div>')
>>> elements = document.getElementsByTag('h3')
>>> len(elements)
2
>>> elements[0].innerHTML
'Abc'
>>> elements[0].attributes
{'color': 'blue', 'align': 'center'}

License

Dompy is GNU GPL v3.0 licensed, as found in the LICENSE file.

About

JavaScript Dom Api for Python, Html Parser and a Web scraping tool in python

Topics

Resources

License

GPL-3.0, GPL-3.0 licenses found

Licenses found

GPL-3.0
LICENSE
GPL-3.0
LICENSE.txt

Stars

Watchers

Forks

Packages

No packages published