Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
.. image:: https://img.shields.io/pypi/v/itemloaders.svg :target: https://pypi.python.org/pypi/itemloaders :alt: PyPI Version
.. image:: https://img.shields.io/pypi/pyversions/itemloaders.svg :target: https://pypi.python.org/pypi/itemloaders :alt: Supported Python Versions
.. image:: https://github.com/scrapy/itemloaders/workflows/CI/badge.svg?branch=master :target: https://github.com/scrapy/itemloaders/actions?workflow=CI :alt: CI Status
.. image:: https://codecov.io/github/scrapy/itemloaders/coverage.svg?branch=master :target: https://codecov.io/gh/scrapy/itemloaders :alt: Coverage report
.. image:: https://readthedocs.org/projects/itemloaders/badge/?version=latest :target: https://itemloaders.readthedocs.io/en/latest/?badge=latest :alt: Documentation Status
itemloaders
is a library that helps you collect data from HTML and XML sources.
It comes in handy to extract data from web pages, as it supports data extraction using CSS and XPath Selectors.
It's specially useful when you need to standardize the data from many sources. For example, it allows you to have all your casting and parsing rules in a single place.
Here is an example to get you started::
from itemloaders import ItemLoader
from parsel import Selector
html_data = '''
<!DOCTYPE html>
<html>
<head>
<title>Some random product page</title>
</head>
<body>
<div class="product_name">Some random product page</div>
<p id="price">$ 100.12</p>
</body>
</html>
'''
loader = ItemLoader(selector=Selector(html_data))
loader.add_xpath('name', '//div[@class="product_name"]/text()')
loader.add_xpath('name', '//div[@class="product_title"]/text()')
loader.add_css('price', '#price::text')
loader.add_value('last_updated', 'today') # you can also use literal values
item = loader.load_item()
item
# {'name': ['Some random product page'], 'price': ['$ 100.12'], 'last_updated': ['today']}
For more information, check out the documentation <https://itemloaders.readthedocs.io/en/latest/>
_.
All contributions are welcome!
If you want to review some code, check open
Pull Requests here <https://github.com/scrapy/itemloaders/pulls>
_
If you want to submit a code change
issue here <https://github.com/scrapy/itemloaders/issues>
_, if there isn't one yetpre-commit install
to install pre-commit hooksFAQs
Base library for scrapy's ItemLoader
We found that itemloaders demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.