parsagon 0.14.40__py3-none-any.whl → 0.15.1__py3-none-any.whl

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.
parsagon/executor.py CHANGED
@@ -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
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: parsagon
3
- Version: 0.14.40
3
+ Version: 0.15.1
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
@@ -10,7 +10,7 @@ Requires-Python: >=3.8
10
10
  Description-Content-Type: text/markdown
11
11
  Requires-Dist: selenium==4.9.1
12
12
  Requires-Dist: lxml==4.9.2
13
- Requires-Dist: httpx==0.27.0
13
+ Requires-Dist: httpx>=0.27.0
14
14
  Requires-Dist: psutil==5.9.6
15
15
  Requires-Dist: rich==13.6.0
16
16
  Requires-Dist: PyVirtualDisplay==3.0
@@ -5,7 +5,7 @@ parsagon/create.py,sha256=BERrBviwMvifg5OwApqdanvULJHHk39fIvnTCZN3Xkk,4432
5
5
  parsagon/custom_function.py,sha256=oEj28qItaHUnsvLIHD7kg5QL3J3aO6rW6xKKP-H-Drs,770
6
6
  parsagon/edit.py,sha256=5gtnx0gNB7Gvz8ET00SczE-ZS0TomN1um6uObP-OObE,3120
7
7
  parsagon/exceptions.py,sha256=tG1vnpmUN1GdJ1GSpe1MaWH3zWmFLZCwtOfEGu8qPP0,910
8
- parsagon/executor.py,sha256=8p0rkgzbp5KeOahwWC0e9suP54iDPauHhn_sdAurmmI,29246
8
+ parsagon/executor.py,sha256=bnwAksrXd4qbWkeV8-JfR3ASreajjGfiNZQRmZM-42Q,29554
9
9
  parsagon/gui_entry.py,sha256=bqG9K0CArXWWwDGoT8aV17YLNM8MfjSf6SJ_B3QbNeA,671
10
10
  parsagon/highlights.js,sha256=2UDfUApblU9xtGgTLCq4X7rHRV0wcqDSSFZPmJS6fJg,16643
11
11
  parsagon/main.py,sha256=LIUE3sfiU7cuz44jgTTfSG807EHJa8avCKtJS1fF18s,9863
@@ -25,8 +25,8 @@ parsagon/tests/test_invalid_args.py,sha256=TAFdHGy92lUxjljPrtODOuEGVss6rn-F5GvEK
25
25
  parsagon/tests/test_pipeline_operations.py,sha256=aEwZNtIwOl9X7jdLDLB4YEdgMp7_x8PXCINAE7RT4NY,805
26
26
  parsagon/tests/test_print.py,sha256=BG7f55YDBoL0S7k291-so_Gje_hUAQOkB-jh-bEYsJY,198
27
27
  parsagon/tests/test_secrets.py,sha256=Ctsscl2tmMTZcFAy5dnyqUlgTov2UharZgLpbRCLdEg,2662
28
- parsagon-0.14.40.dist-info/METADATA,sha256=TWTxsqfkoLUgI1Xtn3M5bVJ1IOe-8nGtJPZ46VbmaFo,2556
29
- parsagon-0.14.40.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
30
- parsagon-0.14.40.dist-info/entry_points.txt,sha256=I1UlPUb4oY2k9idkI8kvdkEcrjKGRSOl5pMbA6uu6kw,48
31
- parsagon-0.14.40.dist-info/top_level.txt,sha256=ih5uYQzW4qjhRKppys-WiHLIbXVZ99YdqDcfAtlcQwk,9
32
- parsagon-0.14.40.dist-info/RECORD,,
28
+ parsagon-0.15.1.dist-info/METADATA,sha256=CPNy3SxCH3l_qBMe-aK0Zi9zhHXT06XXANCjcTUqao4,2555
29
+ parsagon-0.15.1.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
30
+ parsagon-0.15.1.dist-info/entry_points.txt,sha256=I1UlPUb4oY2k9idkI8kvdkEcrjKGRSOl5pMbA6uu6kw,48
31
+ parsagon-0.15.1.dist-info/top_level.txt,sha256=ih5uYQzW4qjhRKppys-WiHLIbXVZ99YdqDcfAtlcQwk,9
32
+ parsagon-0.15.1.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.8.0)
2
+ Generator: setuptools (78.1.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5