From 55e561def69fc115dd92262431ebb73497ffc249 Mon Sep 17 00:00:00 2001 From: magmueller Date: Fri, 29 Nov 2024 08:59:14 +0100 Subject: [PATCH 1/2] Update how we import buildDomTree --- browser_use/dom/service.py | 2 +- pyproject.toml | 13 +------------ 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/browser_use/dom/service.py b/browser_use/dom/service.py index 22d3884..ae8f214 100644 --- a/browser_use/dom/service.py +++ b/browser_use/dom/service.py @@ -28,7 +28,7 @@ async def get_clickable_elements(self, highlight_elements: bool = True) -> DOMSt return DOMState(element_tree=element_tree, selector_map=selector_map) async def _build_dom_tree(self, highlight_elements: bool) -> DOMElementNode: - js_code = resources.files('browser_use.dom').joinpath('buildDomTree.js').read_text() + js_code = resources.read_text('browser_use.dom', 'buildDomTree.js') eval_page = await self.page.evaluate( js_code, [highlight_elements] diff --git a/pyproject.toml b/pyproject.toml index 7803b90..7866898 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -46,15 +46,4 @@ docstring-code-format = true [build-system] requires = ["hatchling"] -build-backend = "hatchling.build" - -[tool.hatch.build.targets.wheel] -packages = ["browser_use"] - -[tool.hatch.build.targets.wheel.force-include] -"browser_use/dom/buildDomTree.js" = "browser_use/dom/buildDomTree.js" - -[tool.hatch.build] -include = [ - "browser_use/**/*.js", -] +build-backend = "hatchling.build" \ No newline at end of file From 024c338bf4ffd02ad60a70e0e3270d6f1e352c92 Mon Sep 17 00:00:00 2001 From: magmueller Date: Fri, 29 Nov 2024 09:04:39 +0100 Subject: [PATCH 2/2] Update version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 7866898..bb83ec4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ description = "Make websites accessible for AI agents" authors = [ { name = "Gregor Zunic" } ] -version = "0.1.14" +version = "0.1.15" readme = "README.md" requires-python = ">=3.11" classifiers = [