1.. :changelog: 2 3History 4------- 5 61.5.1 (2018-10-25) 7~~~~~~~~~~~~~~~~~~ 8 9* ``has-class`` XPath function handles newlines and other separators 10 in class names properly; 11* fixed parsing of HTML documents with null bytes; 12* documentation improvements; 13* Python 3.7 tests are run on CI; other test improvements. 14 151.5.0 (2018-07-04) 16~~~~~~~~~~~~~~~~~~ 17 18* New ``Selector.attrib`` and ``SelectorList.attrib`` properties which make 19 it easier to get attributes of HTML elements. 20* CSS selectors became faster: compilation results are cached 21 (LRU cache is used for ``css2xpath``), so there is 22 less overhead when the same CSS expression is used several times. 23* ``.get()`` and ``.getall()`` selector methods are documented and recommended 24 over ``.extract_first()`` and ``.extract()``. 25* Various documentation tweaks and improvements. 26 27One more change is that ``.extract()`` and ``.extract_first()`` methods 28are now implemented using ``.get()`` and ``.getall()``, not the other 29way around, and instead of calling ``Selector.extract`` all other methods 30now call ``Selector.get`` internally. It can be **backwards incompatible** 31in case of custom Selector subclasses which override ``Selector.extract`` 32without doing the same for ``Selector.get``. If you have such Selector 33subclass, make sure ``get`` method is also overridden. For example, this:: 34 35 class MySelector(parsel.Selector): 36 def extract(self): 37 return super().extract() + " foo" 38 39should be changed to this:: 40 41 class MySelector(parsel.Selector): 42 def get(self): 43 return super().get() + " foo" 44 extract = get 45 46 471.4.0 (2018-02-08) 48~~~~~~~~~~~~~~~~~~ 49 50* ``Selector`` and ``SelectorList`` can't be pickled because 51 pickling/unpickling doesn't work for ``lxml.html.HtmlElement``; 52 parsel now raises TypeError explicitly instead of allowing pickle to 53 silently produce wrong output. This is technically backwards-incompatible 54 if you're using Python < 3.6. 55 56 571.3.1 (2017-12-28) 58~~~~~~~~~~~~~~~~~~ 59 60* Fix artifact uploads to pypi. 61 62 631.3.0 (2017-12-28) 64~~~~~~~~~~~~~~~~~~ 65 66* ``has-class`` XPath extension function; 67* ``parsel.xpathfuncs.set_xpathfunc`` is a simplified way to register 68 XPath extensions; 69* ``Selector.remove_namespaces`` now removes namespace declarations; 70* Python 3.3 support is dropped; 71* ``make htmlview`` command for easier Parsel docs development. 72* CI: PyPy installation is fixed; parsel now runs tests for PyPy3 as well. 73 74 751.2.0 (2017-05-17) 76~~~~~~~~~~~~~~~~~~ 77 78* Add ``SelectorList.get`` and ``SelectorList.getall`` 79 methods as aliases for ``SelectorList.extract_first`` 80 and ``SelectorList.extract`` respectively 81* Add default value parameter to ``SelectorList.re_first`` method 82* Add ``Selector.re_first`` method 83* Add ``replace_entities`` argument on ``.re()`` and ``.re_first()`` 84 to turn off replacing of character entity references 85* Bug fix: detect ``None`` result from lxml parsing and fallback with an empty document 86* Rearrange XML/HTML examples in the selectors usage docs 87* Travis CI: 88 89 * Test against Python 3.6 90 * Test against PyPy using "Portable PyPy for Linux" distribution 91 92 931.1.0 (2016-11-22) 94~~~~~~~~~~~~~~~~~~ 95 96* Change default HTML parser to `lxml.html.HTMLParser <http://lxml.de/api/lxml.html.HTMLParser-class.html>`_, 97 which makes easier to use some HTML specific features 98* Add css2xpath function to translate CSS to XPath 99* Add support for ad-hoc namespaces declarations 100* Add support for XPath variables 101* Documentation improvements and updates 102 103 1041.0.3 (2016-07-29) 105~~~~~~~~~~~~~~~~~~ 106 107* Add BSD-3-Clause license file 108* Re-enable PyPy tests 109* Integrate py.test runs with setuptools (needed for Debian packaging) 110* Changelog is now called ``NEWS`` 111 112 1131.0.2 (2016-04-26) 114~~~~~~~~~~~~~~~~~~ 115 116* Fix bug in exception handling causing original traceback to be lost 117* Added docstrings and other doc fixes 118 119 1201.0.1 (2015-08-24) 121~~~~~~~~~~~~~~~~~~ 122 123* Updated PyPI classifiers 124* Added docstrings for csstranslator module and other doc fixes 125 126 1271.0.0 (2015-08-22) 128~~~~~~~~~~~~~~~~~~ 129 130* Documentation fixes 131 132 1330.9.6 (2015-08-14) 134~~~~~~~~~~~~~~~~~~ 135 136* Updated documentation 137* Extended test coverage 138 139 1400.9.5 (2015-08-11) 141~~~~~~~~~~~~~~~~~~ 142 143* Support for extending SelectorList 144 145 1460.9.4 (2015-08-10) 147~~~~~~~~~~~~~~~~~~ 148 149* Try workaround for travis-ci/dpl#253 150 151 1520.9.3 (2015-08-07) 153~~~~~~~~~~~~~~~~~~ 154 155* Add base_url argument 156 157 1580.9.2 (2015-08-07) 159~~~~~~~~~~~~~~~~~~ 160 161* Rename module unified -> selector and promoted root attribute 162* Add create_root_node function 163 164 1650.9.1 (2015-08-04) 166~~~~~~~~~~~~~~~~~~ 167 168* Setup Sphinx build and docs structure 169* Build universal wheels 170* Rename some leftovers from package extraction 171 172 1730.9.0 (2015-07-30) 174~~~~~~~~~~~~~~~~~~ 175 176* First release on PyPI. 177