Skip to content

Releases: byteface/domonic

FrackOverflow

11 Feb 22:57
Compare
Choose a tag to compare

Adds polygon fixes in d3 module by FrackOverlow

Adds cssselect lib

parsers

24 Jan 23:50
Compare
Choose a tag to compare

html5lib included now by default.

also new ext for html5_parser...

import html5_parser
from domonic.ext.html5_parser_ import parse
root = parse(some_html_string, treebuilder='domonic')

turns out that's a pain to get working on windows though.

isort

22 Jan 01:51
Compare
Choose a tag to compare
  • used isort on everything. broke a bunch of stuff. fixed it. you may get issues. geom package a little in flux.
  • runs black on main moving forward.
  • update readme with info about xpath
  • wont need to build repo docs as often as should get built by readthedocs anyway
  • add contributers to md
  • fix dev requirement update from dependabot
  • make use of xpath as a command line util
  • adds fixes to xpath so you dont need underscore for attribute. and upgrades strings to Text nodes

xpath

16 Jan 13:05
Compare
Choose a tag to compare

Kind of a pre-release. Still undocumented and thoroughly tested...

domonic now includes a lib for xpath: https://pypi.org/project/elementpath/

early days but lots of unit tests just seem to be working out of the box.

gotchas : attributes require underscore... thinking about how to solve that atm.

for usage examples see /tests/test_webapi.test_xpath... i.e.

import requests
r = requests.get("http://eventual.technology")
page = domonic.parseString(r.content.decode("utf-8"))  # NOTE - requires install html5lib 
evaluator = XPathEvaluator()
expression = evaluator.createExpression("//h1")
result = expression.evaluate(page, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE)
print(str(result.nodes[0]))

css

14 Dec 12:56
Compare
Choose a tag to compare
css

more css props and parser added. inspired by happy dom (a js dom alternative to jsdom)

screen class added to window module but only for default values.

i think regex.exec in js needs redoing but d3 format uses it. need to check that.

will need to start increasing css tests.

document.stylesheets

04 Dec 14:15
Compare
Choose a tag to compare
from domonic.window import *
window.location = "https://www.facebook.com"
window.document.stylesheets

made a start on cssom. well. not really just loading the style sheets. been on my todo for a while as that could trigger some growth there.

remove() had a bug which was causing double bodies if using the += operators on body. that was fixed. hopefully this time.

DOMException

04 Dec 01:20
Compare
Choose a tag to compare

fixes a few buggy methods on Document that needed sorting and added a few more tests.

Used it as an opprotunity to throw a DOMException.

dom is king (breaking changes)

03 Dec 00:37
Compare
Choose a tag to compare

This one could cause a lot of breaking changes. pin your version to an older one if you are not ready for it.

basically tag is gone... (well It's now just pointer to dom.Node as a legacy helper.) . which means dom module is now king and the html module is just a wrapper.

This is great for lots of reasons. tag used the be the main class. but as the DOM evolved a wierd multi inheritence thing was starting to happen with overrides for all the init methods to be able to call super on each parent. anyway that's all gone. Now that DOM is mature I figured I could just extend node. Then decided to drop tag altogether. However there's still work to do and this is just the first step on the ladder.

On plus side logging will be nicer and it should be more optimal.

Also dom now has all the proper tag names for classes and html is just a wrapper around those. which changes how the classes were created before. The destruction of tag allowed for them to be easier created as base classes.

however there is some vestigal non standard methods now on Node as remains of tag. I'd rather hide these away. i.e. the 'content' method and some others. also 'name' instead of tagName is being used.

But it should be an improvement and make it easier to dev on. As always moving towards a more standard DOM.

Hope you enjoy it.

HTMLCollection

30 Nov 01:26
Compare
Choose a tag to compare

Made a start on HTMLCollection.

JSON class is gone in favour of just using the module. so you can use it with out doing JSON.JSON. (tho i doubt it gets much use anyway)

modified some internal methods. In long run will need to reverse some of them out from depending on querySelectorAll.

😈

23 Nov 14:45
Compare
Choose a tag to compare

Increased testing to discover/fix bugs. Also added a new command to eval on terminal. Made Events module a bit better.