{"id":16444895,"url":"https://github.com/jaymon/que","last_synced_at":"2026-01-24T18:03:06.164Z","repository":{"id":57459321,"uuid":"91439631","full_name":"Jaymon/que","owner":"Jaymon","description":"CSS selectors for parsing html on the command line","archived":false,"fork":false,"pushed_at":"2023-11-26T21:59:10.000Z","size":15,"stargazers_count":2,"open_issues_count":6,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-23T08:33:22.881Z","etag":null,"topics":["command-line","command-line-tool","commandline","css-selector","python","utility"],"latest_commit_sha":null,"homepage":null,"language":"Python","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/Jaymon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-05-16T09:20:31.000Z","updated_at":"2020-11-11T09:45:26.000Z","dependencies_parsed_at":"2024-10-28T21:01:26.154Z","dependency_job_id":null,"html_url":"https://github.com/Jaymon/que","commit_stats":{"total_commits":10,"total_committers":2,"mean_commits":5.0,"dds":0.09999999999999998,"last_synced_commit":"c1975f3ca58ef8e087ad08ba92cff915337d4da4"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jaymon%2Fque","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jaymon%2Fque/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jaymon%2Fque/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jaymon%2Fque/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Jaymon","download_url":"https://codeload.github.com/Jaymon/que/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247723644,"owners_count":20985398,"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":["command-line","command-line-tool","commandline","css-selector","python","utility"],"created_at":"2024-10-11T09:42:31.601Z","updated_at":"2026-01-24T18:03:06.111Z","avatar_url":"https://github.com/Jaymon.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Que\n\nSlice and dice html on the command line using CSS selectors.\n\n## Quick start\n\nLet's say you want to grab all the links on **http://example.com/foo/bar**:\n\n    $ que \"a-\u003ehref\" \"http://example.com/foo/bar\"\n\nLet's say that gave you 3 lines that looked like this:\n\n    /some/url?val=1\n    /some/url2?val=2\n    /some/url3?val=3\n\nUgh, that's not very helpful, so let's modify our argument a bit:\n\n    $ que \"a-\u003ehttp://example.com{href}\" \"http://example.com/foo/bar\"\n\nNow, that will print:\n\n    http://example.com/some/url?val=1\n    http://example.com/some/url2?val=2\n    http://example.com/some/url3?val=3\n\n\n## Selecting\n\nNot sure how to use CSS Selectors?\n\n* [Beautiful Soup CSS select docs](https://www.crummy.com/software/BeautifulSoup/bs4/doc/#searching-by-css-class)\n* [JQuery's CSS Selector docs](http://api.jquery.com/category/selectors/)\n* [Sauce Labs Tutorial](https://saucelabs.com/resources/articles/selenium-tips-css-selectors)\n* [W3CSchools CSS Selector Reference](https://www.w3schools.com/cssref/css_selectors.asp)\n\nThe selector is divided into two parts separated by `-\u003e`, the first part is the traditional selector talked about in the above links and the second part is the attributes you want to print to the screen for each match:\n\n    $ css.selector-\u003eattribute,...\n\nThe Selector part uses [Python's string formatting syntax](https://docs.python.org/2/library/string.html#formatspec) so you can embed the attributes you want within a larger string.\n\n\n## Examples\n\nFind all the \"Download\" links on a page:\n\nque has support for the the non-standard [:contains css selector](https://www.w3.org/TR/2001/CR-css3-selectors-20011113/#content-selectors)\n\n    $ curl http://example.com | que \"a:contains(Download)-\u003ehref\"\n\n\nSelect all the links with attribute `data` that starts with \"foo\":\n\n    $ curl http://example.com | que \"a[data|=foo]-\u003ehref\"\n\n\n## Installation\n\nYou can use pip to install stable:\n\n    $ pip install que\n\nor the latest and greatest (which might be different than what's on [pypi](https://pypi.python.org/pypi/que):\n\n    $ pip install git+https://github.com/jaymon/que#egg=que\n\n\n## Notes\n\n* If you need a way more fully featured html command line parser, try [hq](https://github.com/rbwinslow/hq).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaymon%2Fque","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjaymon%2Fque","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaymon%2Fque/lists"}