parsagon 0.14.40__tar.gz → 0.15.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. {parsagon-0.14.40 → parsagon-0.15.0}/PKG-INFO +1 -1
  2. {parsagon-0.14.40 → parsagon-0.15.0}/pyproject.toml +1 -1
  3. {parsagon-0.14.40 → parsagon-0.15.0}/src/parsagon/executor.py +7 -1
  4. {parsagon-0.14.40 → parsagon-0.15.0}/src/parsagon.egg-info/PKG-INFO +1 -1
  5. {parsagon-0.14.40 → parsagon-0.15.0}/README.md +0 -0
  6. {parsagon-0.14.40 → parsagon-0.15.0}/setup.cfg +0 -0
  7. {parsagon-0.14.40 → parsagon-0.15.0}/src/__init__.py +0 -0
  8. {parsagon-0.14.40 → parsagon-0.15.0}/src/parsagon/__init__.py +0 -0
  9. {parsagon-0.14.40 → parsagon-0.15.0}/src/parsagon/api.py +0 -0
  10. {parsagon-0.14.40 → parsagon-0.15.0}/src/parsagon/assistant.py +0 -0
  11. {parsagon-0.14.40 → parsagon-0.15.0}/src/parsagon/create.py +0 -0
  12. {parsagon-0.14.40 → parsagon-0.15.0}/src/parsagon/custom_function.py +0 -0
  13. {parsagon-0.14.40 → parsagon-0.15.0}/src/parsagon/edit.py +0 -0
  14. {parsagon-0.14.40 → parsagon-0.15.0}/src/parsagon/exceptions.py +0 -0
  15. {parsagon-0.14.40 → parsagon-0.15.0}/src/parsagon/gui/__init__.py +0 -0
  16. {parsagon-0.14.40 → parsagon-0.15.0}/src/parsagon/gui/controller.py +0 -0
  17. {parsagon-0.14.40 → parsagon-0.15.0}/src/parsagon/gui/menu.py +0 -0
  18. {parsagon-0.14.40 → parsagon-0.15.0}/src/parsagon/gui/window.py +0 -0
  19. {parsagon-0.14.40 → parsagon-0.15.0}/src/parsagon/gui_entry.py +0 -0
  20. {parsagon-0.14.40 → parsagon-0.15.0}/src/parsagon/highlights.js +0 -0
  21. {parsagon-0.14.40 → parsagon-0.15.0}/src/parsagon/main.py +0 -0
  22. {parsagon-0.14.40 → parsagon-0.15.0}/src/parsagon/print.py +0 -0
  23. {parsagon-0.14.40 → parsagon-0.15.0}/src/parsagon/runs.py +0 -0
  24. {parsagon-0.14.40 → parsagon-0.15.0}/src/parsagon/secrets.py +0 -0
  25. {parsagon-0.14.40 → parsagon-0.15.0}/src/parsagon/settings.py +0 -0
  26. {parsagon-0.14.40 → parsagon-0.15.0}/src/parsagon/tests/__init__.py +0 -0
  27. {parsagon-0.14.40 → parsagon-0.15.0}/src/parsagon/tests/api_mocks.py +0 -0
  28. {parsagon-0.14.40 → parsagon-0.15.0}/src/parsagon/tests/conftest.py +0 -0
  29. {parsagon-0.14.40 → parsagon-0.15.0}/src/parsagon/tests/test_executor.py +0 -0
  30. {parsagon-0.14.40 → parsagon-0.15.0}/src/parsagon/tests/test_invalid_args.py +0 -0
  31. {parsagon-0.14.40 → parsagon-0.15.0}/src/parsagon/tests/test_pipeline_operations.py +0 -0
  32. {parsagon-0.14.40 → parsagon-0.15.0}/src/parsagon/tests/test_print.py +0 -0
  33. {parsagon-0.14.40 → parsagon-0.15.0}/src/parsagon/tests/test_secrets.py +0 -0
  34. {parsagon-0.14.40 → parsagon-0.15.0}/src/parsagon.egg-info/SOURCES.txt +0 -0
  35. {parsagon-0.14.40 → parsagon-0.15.0}/src/parsagon.egg-info/dependency_links.txt +0 -0
  36. {parsagon-0.14.40 → parsagon-0.15.0}/src/parsagon.egg-info/entry_points.txt +0 -0
  37. {parsagon-0.14.40 → parsagon-0.15.0}/src/parsagon.egg-info/requires.txt +0 -0
  38. {parsagon-0.14.40 → parsagon-0.15.0}/src/parsagon.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: parsagon
3
- Version: 0.14.40
3
+ Version: 0.15.0
4
4
  Summary: Allows you to create browser automations with natural language
5
5
  Author-email: Sandy Suh <sandy@parsagon.io>
6
6
  Project-URL: Homepage, https://parsagon.io
@@ -16,7 +16,7 @@ line-length = 120
16
16
 
17
17
  [project]
18
18
  name = "parsagon"
19
- version = "0.14.40"
19
+ version = "0.15.0"
20
20
  description = "Allows you to create browser automations with natural language"
21
21
  readme = "README.md"
22
22
  requires-python = ">=3.8"
@@ -634,6 +634,7 @@ class Executor:
634
634
  nodes = {}
635
635
  css_selectors = {}
636
636
  xpath_selectors = {}
637
+ flagged_fields = {}
637
638
  if not self.infer:
638
639
  field_types = get_schema_fields(schema)
639
640
  for field, field_type in field_types.items():
@@ -659,13 +660,17 @@ class Executor:
659
660
  else:
660
661
  browser_print("Scraping data...")
661
662
  result = scrape_page(self.get_visible_html(), schema, self.task, html)
663
+ print(result)
662
664
  scraped_data = result["data"]
663
665
  nodes = result["nodes"]
666
+ css_selectors = result["css"]
667
+ xpath_selectors = result["xpath"]
668
+ flagged_fields = result["flagged"]
664
669
  if not scraped_data or not nodes:
665
670
  raise ParsagonException(
666
671
  f"Parsagon could not find any data on the page that would fit the format {schema}. You can try rephrasing your prompt, or you can run Parsagon in manual mode to click on elements you want to scrape."
667
672
  )
668
- browser_print(f"Scraped data:\n{scraped_data}")
673
+ browser_print(f"Scraped data:\n{scraped_data}\nFlagged fields: {[k for k, v in flagged_fields.items() if v]}\n")
669
674
 
670
675
  custom_function = CustomFunction(
671
676
  "scrape_data",
@@ -679,6 +684,7 @@ class Executor:
679
684
  "nodes": nodes,
680
685
  "css_selectors": css_selectors,
681
686
  "xpath_selectors": xpath_selectors,
687
+ "flagged_fields": flagged_fields,
682
688
  "scraped_data": copy.deepcopy(scraped_data),
683
689
  }
684
690
  ],
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: parsagon
3
- Version: 0.14.40
3
+ Version: 0.15.0
4
4
  Summary: Allows you to create browser automations with natural language
5
5
  Author-email: Sandy Suh <sandy@parsagon.io>
6
6
  Project-URL: Homepage, https://parsagon.io
File without changes
File without changes
File without changes