v0.1.2

D4Vinci/Scraplingv0.1.2Oct 16, 2024by D4Vinci

AI Summary

Fixed the `keep_comments` argument behavior and improved HTML comment removal in text extraction, along with fixing SQLite database cleanup.

Key Highlights

  • Fixed `keep_comments` argument functionality.
  • Text function now automatically removes HTML comments.
  • Fixed SQLite db file deletion on uninstall.

New Features

  • Fixed keep_comments argument.
  • Auto HTML comment removal in text extraction.
  • Fixed SQLite cleanup on uninstall.

Full Release Notes

**Changelog**:
- Fixed a bug where the `keep_comments` argument is not working as intended.
- Adjusted the text function to automatically remove HTML comments from elements before extracting its text to prevent Lxml different behavior, for example:
  ```python
  >>> page = Adaptor('<span>CONDITION: <!-- -->Excellent</span>', keep_comments=True)
  >>> page.css('span::text')
  ['CONDITION: ', 'Excellent']
  ```
  previously would result in this because of Lxml default behavior but now it would return the full text 'CONDITION: Excellent'
  This behavior is known with parsel\scrapy as well so wanted to handle it here.
- Fixed a bug where the SQLite db file created by the library is not deleted when doing `pip uninstall scrapling` or similar.