parsagon 0.14.33__py3-none-any.whl → 0.14.35__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 +17 -0
- {parsagon-0.14.33.dist-info → parsagon-0.14.35.dist-info}/METADATA +3 -1
- {parsagon-0.14.33.dist-info → parsagon-0.14.35.dist-info}/RECORD +6 -6
- {parsagon-0.14.33.dist-info → parsagon-0.14.35.dist-info}/WHEEL +1 -1
- {parsagon-0.14.33.dist-info → parsagon-0.14.35.dist-info}/entry_points.txt +0 -0
- {parsagon-0.14.33.dist-info → parsagon-0.14.35.dist-info}/top_level.txt +0 -0
parsagon/executor.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
from collections import defaultdict
|
2
2
|
import copy
|
3
|
+
import dateutil.parser
|
3
4
|
import glob
|
4
5
|
import json
|
5
6
|
import logging
|
@@ -9,6 +10,7 @@ import psutil
|
|
9
10
|
import time
|
10
11
|
from urllib.parse import urljoin
|
11
12
|
|
13
|
+
import html2text
|
12
14
|
from lxml import etree
|
13
15
|
import lxml.html
|
14
16
|
from pypdf import PdfReader
|
@@ -150,6 +152,7 @@ class Executor:
|
|
150
152
|
"get_json_about_data": get_json_about_data,
|
151
153
|
"get_serp_data": get_serp_data,
|
152
154
|
"get_pdf_text": self.get_pdf_text,
|
155
|
+
"str_to_iso8601": self.str_to_iso8601,
|
153
156
|
}
|
154
157
|
self.custom_functions = {}
|
155
158
|
self.infer = infer
|
@@ -587,6 +590,12 @@ class Executor:
|
|
587
590
|
elem = self._id_to_elem(elem_id)
|
588
591
|
return elem.get_attribute("innerText")
|
589
592
|
|
593
|
+
def get_inner_markdown(self, window_id):
|
594
|
+
if self.driver.current_window_handle != window_id:
|
595
|
+
self.driver.switch_to.window(window_id)
|
596
|
+
html = self.driver.execute_script("return document.body.innerHTML;")
|
597
|
+
return html2text.html2text(html)
|
598
|
+
|
590
599
|
def scrape_data(self, schema, window_id, call_id):
|
591
600
|
"""
|
592
601
|
Scrapes data from the current page.
|
@@ -671,6 +680,14 @@ class Executor:
|
|
671
680
|
os.remove(most_recent_file)
|
672
681
|
return text
|
673
682
|
|
683
|
+
def str_to_iso8601(self, s):
|
684
|
+
while s:
|
685
|
+
try:
|
686
|
+
return dateutil.parser.parse(s).isoformat()
|
687
|
+
except dateutil.parser._parser.ParserError:
|
688
|
+
s = " ".join(s.split()[:-1])
|
689
|
+
return ""
|
690
|
+
|
674
691
|
def execute(self, code):
|
675
692
|
loc = {}
|
676
693
|
try:
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: parsagon
|
3
|
-
Version: 0.14.
|
3
|
+
Version: 0.14.35
|
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
|
@@ -21,6 +21,8 @@ Requires-Dist: webdriver-manager==4.0.2
|
|
21
21
|
Requires-Dist: jsonpath-ng==1.5.3
|
22
22
|
Requires-Dist: simplejson==3.19.1
|
23
23
|
Requires-Dist: pypdf==4.2.0
|
24
|
+
Requires-Dist: python-dateutil==2.9.0.post0
|
25
|
+
Requires-Dist: html2text==2024.2.26
|
24
26
|
Provides-Extra: dev
|
25
27
|
Requires-Dist: pytest==7.3.2; extra == "dev"
|
26
28
|
Requires-Dist: pytest-mock==3.11.1; extra == "dev"
|
@@ -5,7 +5,7 @@ parsagon/create.py,sha256=igrJN8jVP5p3P9-dPSabrHGOQOlG2Flx7ep4SqEDB14,4373
|
|
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=
|
8
|
+
parsagon/executor.py,sha256=5rDPomE_iC8OZP9NBrq39MCO7vQqUE1uf1H7repjS1I,28399
|
9
9
|
parsagon/gui_entry.py,sha256=bqG9K0CArXWWwDGoT8aV17YLNM8MfjSf6SJ_B3QbNeA,671
|
10
10
|
parsagon/highlights.js,sha256=2UDfUApblU9xtGgTLCq4X7rHRV0wcqDSSFZPmJS6fJg,16643
|
11
11
|
parsagon/main.py,sha256=WPxrT1ZyPe6wNSFP7GnnKIGisgPM2dFieHP2TC5TGVQ,9467
|
@@ -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.
|
29
|
-
parsagon-0.14.
|
30
|
-
parsagon-0.14.
|
31
|
-
parsagon-0.14.
|
32
|
-
parsagon-0.14.
|
28
|
+
parsagon-0.14.35.dist-info/METADATA,sha256=cEDoSbH8qv3Xbt14NQkWlSJ6cQuQIb10Ro3ft7yyyRU,2522
|
29
|
+
parsagon-0.14.35.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
30
|
+
parsagon-0.14.35.dist-info/entry_points.txt,sha256=I1UlPUb4oY2k9idkI8kvdkEcrjKGRSOl5pMbA6uu6kw,48
|
31
|
+
parsagon-0.14.35.dist-info/top_level.txt,sha256=ih5uYQzW4qjhRKppys-WiHLIbXVZ99YdqDcfAtlcQwk,9
|
32
|
+
parsagon-0.14.35.dist-info/RECORD,,
|
File without changes
|
File without changes
|