{"id":13565114,"url":"https://github.com/scrapehero/selectorlib","last_synced_at":"2025-04-03T22:30:40.966Z","repository":{"id":43324039,"uuid":"187769171","full_name":"scrapehero/selectorlib","owner":"scrapehero","description":"A library to read a YML file with Xpath or CSS Selectors and extract data from HTML pages using them ","archived":false,"fork":false,"pushed_at":"2023-01-30T04:38:57.000Z","size":349,"stargazers_count":62,"open_issues_count":6,"forks_count":11,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-03-25T20:54:05.128Z","etag":null,"topics":["python","scraping","selectors","web-scraping","xpath"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/scrapehero.png","metadata":{"files":{"readme":"README.rst","changelog":"HISTORY.rst","contributing":"CONTRIBUTING.rst","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-05-21T05:42:10.000Z","updated_at":"2024-01-29T23:46:47.000Z","dependencies_parsed_at":"2023-02-16T04:01:10.541Z","dependency_job_id":null,"html_url":"https://github.com/scrapehero/selectorlib","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scrapehero%2Fselectorlib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scrapehero%2Fselectorlib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scrapehero%2Fselectorlib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scrapehero%2Fselectorlib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scrapehero","download_url":"https://codeload.github.com/scrapehero/selectorlib/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247089751,"owners_count":20881832,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["python","scraping","selectors","web-scraping","xpath"],"created_at":"2024-08-01T13:01:41.037Z","updated_at":"2025-04-03T22:30:36.578Z","avatar_url":"https://github.com/scrapehero.png","language":"HTML","funding_links":[],"categories":["HTML"],"sub_categories":[],"readme":"===========\nselectorlib\n===========\n\n\n.. image:: https://img.shields.io/pypi/v/selectorlib.svg\n        :target: https://pypi.python.org/pypi/selectorlib\n\n.. image:: https://img.shields.io/travis/scrapehero/selectorlib.svg\n        :target: https://travis-ci.org/scrapehero/selectorlib\n\n.. image:: https://readthedocs.org/projects/selectorlib/badge/?version=latest\n        :target: https://selectorlib.readthedocs.io/en/latest/?badge=latest\n        :alt: Documentation Status\n\n\n.. image:: https://pyup.io/repos/github/scrapehero/selectorlib/shield.svg\n     :target: https://pyup.io/repos/github/scrapehero/selectorlib/\n     :alt: Updates\n\n\n\nA library to read a YML file with Xpath or CSS Selectors and extract data from HTML pages using them\n\n* Free software: MIT license\n* Documentation: https://selectorlib.readthedocs.io.\n\n\nExample\n--------\n\n\u003e\u003e\u003e from selectorlib import Extractor\n\u003e\u003e\u003e yaml_string = \"\"\"\n    title:\n        css: \"h1\"\n        type: Text\n    link:\n        css: \"h2 a\"\n        type: Link\n    \"\"\"\n\u003e\u003e\u003e extractor = Extractor.from_yaml_string(yaml_string)\n\u003e\u003e\u003e html = \"\"\"\n    \u003ch1\u003eTitle\u003c/h1\u003e\n    \u003ch2\u003eUsage\n        \u003ca class=\"headerlink\" href=\"http://test\"\u003e¶\u003c/a\u003e\n    \u003c/h2\u003e\n    \"\"\"\n\u003e\u003e\u003e extractor.extract(html)\n{'title': 'Title', 'link': 'http://test'}\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscrapehero%2Fselectorlib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscrapehero%2Fselectorlib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscrapehero%2Fselectorlib/lists"}