parsagon 0.14.15__tar.gz → 0.14.17__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.
- {parsagon-0.14.15 → parsagon-0.14.17}/PKG-INFO +1 -1
- {parsagon-0.14.15 → parsagon-0.14.17}/pyproject.toml +1 -1
- {parsagon-0.14.15 → parsagon-0.14.17}/src/parsagon/__init__.py +1 -0
- {parsagon-0.14.15 → parsagon-0.14.17}/src/parsagon/assistant.py +8 -8
- {parsagon-0.14.15 → parsagon-0.14.17}/src/parsagon/executor.py +14 -1
- {parsagon-0.14.15 → parsagon-0.14.17}/src/parsagon.egg-info/PKG-INFO +1 -1
- {parsagon-0.14.15 → parsagon-0.14.17}/README.md +0 -0
- {parsagon-0.14.15 → parsagon-0.14.17}/setup.cfg +0 -0
- {parsagon-0.14.15 → parsagon-0.14.17}/src/__init__.py +0 -0
- {parsagon-0.14.15 → parsagon-0.14.17}/src/parsagon/api.py +0 -0
- {parsagon-0.14.15 → parsagon-0.14.17}/src/parsagon/create.py +0 -0
- {parsagon-0.14.15 → parsagon-0.14.17}/src/parsagon/custom_function.py +0 -0
- {parsagon-0.14.15 → parsagon-0.14.17}/src/parsagon/edit.py +0 -0
- {parsagon-0.14.15 → parsagon-0.14.17}/src/parsagon/exceptions.py +0 -0
- {parsagon-0.14.15 → parsagon-0.14.17}/src/parsagon/gui/__init__.py +0 -0
- {parsagon-0.14.15 → parsagon-0.14.17}/src/parsagon/gui/controller.py +0 -0
- {parsagon-0.14.15 → parsagon-0.14.17}/src/parsagon/gui/menu.py +0 -0
- {parsagon-0.14.15 → parsagon-0.14.17}/src/parsagon/gui/window.py +0 -0
- {parsagon-0.14.15 → parsagon-0.14.17}/src/parsagon/gui_entry.py +0 -0
- {parsagon-0.14.15 → parsagon-0.14.17}/src/parsagon/highlights.js +0 -0
- {parsagon-0.14.15 → parsagon-0.14.17}/src/parsagon/main.py +0 -0
- {parsagon-0.14.15 → parsagon-0.14.17}/src/parsagon/print.py +0 -0
- {parsagon-0.14.15 → parsagon-0.14.17}/src/parsagon/runs.py +0 -0
- {parsagon-0.14.15 → parsagon-0.14.17}/src/parsagon/secrets.py +0 -0
- {parsagon-0.14.15 → parsagon-0.14.17}/src/parsagon/settings.py +0 -0
- {parsagon-0.14.15 → parsagon-0.14.17}/src/parsagon/tests/__init__.py +0 -0
- {parsagon-0.14.15 → parsagon-0.14.17}/src/parsagon/tests/api_mocks.py +0 -0
- {parsagon-0.14.15 → parsagon-0.14.17}/src/parsagon/tests/conftest.py +0 -0
- {parsagon-0.14.15 → parsagon-0.14.17}/src/parsagon/tests/test_executor.py +0 -0
- {parsagon-0.14.15 → parsagon-0.14.17}/src/parsagon/tests/test_invalid_args.py +0 -0
- {parsagon-0.14.15 → parsagon-0.14.17}/src/parsagon/tests/test_pipeline_operations.py +0 -0
- {parsagon-0.14.15 → parsagon-0.14.17}/src/parsagon/tests/test_print.py +0 -0
- {parsagon-0.14.15 → parsagon-0.14.17}/src/parsagon/tests/test_secrets.py +0 -0
- {parsagon-0.14.15 → parsagon-0.14.17}/src/parsagon.egg-info/SOURCES.txt +0 -0
- {parsagon-0.14.15 → parsagon-0.14.17}/src/parsagon.egg-info/dependency_links.txt +0 -0
- {parsagon-0.14.15 → parsagon-0.14.17}/src/parsagon.egg-info/entry_points.txt +0 -0
- {parsagon-0.14.15 → parsagon-0.14.17}/src/parsagon.egg-info/requires.txt +0 -0
- {parsagon-0.14.15 → parsagon-0.14.17}/src/parsagon.egg-info/top_level.txt +0 -0
@@ -3,3 +3,4 @@ from parsagon.create import create_program as create
|
|
3
3
|
from parsagon.runs import run, batch_runs
|
4
4
|
from parsagon.api import get_str_about_data, get_bool_about_data, get_json_about_data
|
5
5
|
from parsagon.assistant import get_page_html, get_page_text
|
6
|
+
from parsagon.executor import Executor
|
@@ -65,11 +65,11 @@ def assist(verbose=False):
|
|
65
65
|
break
|
66
66
|
|
67
67
|
|
68
|
-
def get_page_html(url, headless=False, use_uc=False,
|
68
|
+
def get_page_html(url, headless=False, use_uc=False, page_load_timeout=None, script_timeout=None):
|
69
69
|
browser_print(f"Checking what {url} looks like...")
|
70
|
-
executor = Executor(
|
71
|
-
|
72
|
-
|
70
|
+
executor = Executor(
|
71
|
+
"", headless=headless, use_uc=use_uc, page_load_timeout=page_load_timeout, script_timeout=script_timeout
|
72
|
+
)
|
73
73
|
try:
|
74
74
|
executor.goto(url)
|
75
75
|
html = executor.get_visible_html()
|
@@ -78,11 +78,11 @@ def get_page_html(url, headless=False, use_uc=False, timeout=None):
|
|
78
78
|
return html
|
79
79
|
|
80
80
|
|
81
|
-
def get_page_text(url, headless=False, use_uc=False,
|
81
|
+
def get_page_text(url, headless=False, use_uc=False, page_load_timeout=None, script_timeout=None):
|
82
82
|
browser_print(f"Checking what {url} looks like...")
|
83
|
-
executor = Executor(
|
84
|
-
|
85
|
-
|
83
|
+
executor = Executor(
|
84
|
+
"", headless=headless, use_uc=use_uc, page_load_timeout=page_load_timeout, script_timeout=script_timeout
|
85
|
+
)
|
86
86
|
try:
|
87
87
|
executor.goto(url)
|
88
88
|
text = executor.driver.execute_script("return document.body.innerText;")
|
@@ -64,7 +64,16 @@ class Executor:
|
|
64
64
|
Executes code produced by GPT with the proper context. Records custom_function usage along the way.
|
65
65
|
"""
|
66
66
|
|
67
|
-
def __init__(
|
67
|
+
def __init__(
|
68
|
+
self,
|
69
|
+
task,
|
70
|
+
headless=False,
|
71
|
+
infer=False,
|
72
|
+
use_uc=False,
|
73
|
+
page_load_timeout=None,
|
74
|
+
script_timeout=None,
|
75
|
+
function_bank={},
|
76
|
+
):
|
68
77
|
self.task = task
|
69
78
|
self.headless = headless
|
70
79
|
self.function_bank = function_bank
|
@@ -79,6 +88,10 @@ class Executor:
|
|
79
88
|
chrome_options = webdriver.ChromeOptions()
|
80
89
|
chrome_options.add_argument("--start-maximized")
|
81
90
|
self.driver = webdriver.Chrome(service=ChromeService(driver_executable_path), options=chrome_options)
|
91
|
+
if page_load_timeout:
|
92
|
+
self.driver.set_page_load_timeout(page_load_timeout)
|
93
|
+
if script_timeout:
|
94
|
+
self.driver.set_script_timeout(script_timeout)
|
82
95
|
self.max_elem_ids = defaultdict(int)
|
83
96
|
self.execution_context = {
|
84
97
|
"custom_assert": self.custom_assert,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|