{"id":16545559,"url":"https://github.com/doctorOb/dompy","last_synced_at":"2025-10-28T15:31:34.997Z","repository":{"id":19161097,"uuid":"22392751","full_name":"doctorOb/dompy","owner":"doctorOb","description":"Javascript DOM objects in python. Parse html like you would in the browser.","archived":false,"fork":false,"pushed_at":"2014-09-14T18:18:15.000Z","size":180,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-10-12T19:07:15.673Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/doctorOb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-07-29T19:34:12.000Z","updated_at":"2014-09-14T18:18:17.000Z","dependencies_parsed_at":"2022-09-02T06:12:01.473Z","dependency_job_id":null,"html_url":"https://github.com/doctorOb/dompy","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doctorOb%2Fdompy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doctorOb%2Fdompy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doctorOb%2Fdompy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doctorOb%2Fdompy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/doctorOb","download_url":"https://codeload.github.com/doctorOb/dompy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238672416,"owners_count":19511267,"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":[],"created_at":"2024-10-11T19:07:04.538Z","updated_at":"2025-10-28T15:31:29.692Z","avatar_url":"https://github.com/doctorOb.png","language":"Python","funding_links":[],"categories":["Libraries"],"sub_categories":["General HTML Generation"],"readme":"dompy\n=====\n\nJavascript DOM objects in python. Parse html like you would in the browser.\n\nThe goal is to implement [XML DOM Elements](http://www.w3schools.com/dom/dom_element.asp) in Python.\n\nBeautifulSoup is a wonderfully robust library for parsing html, and navigating the document tree. However, I found it unpleasent to work with. As someone who's used to manipulating DOM elements in javascript, I wanted the ability to do the same thing in python. \n\nIt (roughly) works as follows:\n\n```\ndocument = dompy.Document(htmlString)\ndocument.getElementsByClassName('td') #get all the TDs in the document\ndocument.getElementById('foo').innerText #get the text in the foo element\n```\n\nBeautifulSoup is still used to parse the html document, but the Tags are then iterated over and converted to a Node class\nwhich aims to closely resemble those found in javascript. So, as you'd access the body's className or tagName just as you would in javascript, like:\n\n```\ndocument.body.className\ndocument.getElementsByName('idk')[0].tagName #figure out what tag has been named so vaguely\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FdoctorOb%2Fdompy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FdoctorOb%2Fdompy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FdoctorOb%2Fdompy/lists"}