Skip to content

CFT and CHS refactoring #3459

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jan 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,27 @@ msedgedriver.exe
operadriver.exe
uc_driver.exe

# Chrome for Testing Zip Files
chrome-mac-arm64.zip
chrome-mac-x64.zip
chrome-linux64.zip
chrome-win64.zip
chrome-win32.zip

# Chrome for Testing folders
chrome-mac-arm64
chrome-mac-x64
chrome-linux64
chrome-win64
chrome-win32

# Chrome-Headless-Shell Zip Files
chrome-headless-shell-mac-arm64.zip
chrome-headless-shell-mac-x64.zip
chrome-headless-shell-linux64.zip
chrome-headless-shell-win64.zip
chrome-headless-shell-win32.zip

# Chrome-Headless-Shell folders
chrome-headless-shell-mac-arm64
chrome-headless-shell-mac-x64
Expand Down
13 changes: 13 additions & 0 deletions examples/cdp_mode/raw_chatgpt.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
from seleniumbase import SB

with SB(uc=True, test=True, ad_block=True) as sb:
url = "https://chatgpt.com/"
sb.activate_cdp_mode(url)
query = "Compare Playwright to SeleniumBase in under 178 words"
sb.type("#prompt-textarea", query)
sb.click('button[data-testid="send-button"]')
print('Input for ChatGPT:\n"%s"' % query)
sb.sleep(12)
chat = sb.find_element('[data-message-author-role="assistant"] .markdown')
soup = sb.get_beautiful_soup(chat.get_html()).get_text("\n").strip()
print("Response from ChatGPT:\n%s" % soup.replace("\n:", ":"))
2 changes: 1 addition & 1 deletion mkdocs_build/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

regex>=2024.11.6
pymdown-extensions>=10.14.1
pipdeptree>=2.24.0
pipdeptree>=2.25.0
python-dateutil>=2.8.2
Markdown==3.7
click==8.1.8
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pip>=24.3.1
pip>=25.0
packaging>=24.2
setuptools~=70.2;python_version<"3.10"
setuptools>=75.8.0;python_version>="3.10"
Expand Down
2 changes: 1 addition & 1 deletion seleniumbase/__version__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# seleniumbase package
__version__ = "4.34.3"
__version__ = "4.34.4"
13 changes: 9 additions & 4 deletions seleniumbase/console_scripts/sb_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import tarfile
import urllib3
import zipfile
from contextlib import suppress
from seleniumbase.fixtures import constants
from seleniumbase.fixtures import shared_utils
from seleniumbase import config as sb_config
Expand Down Expand Up @@ -1200,7 +1201,7 @@ def main(override=None, intel_for_uc=None, force_uc=None):
driver_path = None
driver_file = None
base_path = os.sep.join(zip_file_path.split(os.sep)[:-1])
folder_name = contents[0].split(os.sep)[0]
folder_name = contents[0].split("/")[0]
folder_path = os.path.join(base_path, folder_name)
if IS_MAC or IS_LINUX:
if (
Expand All @@ -1221,12 +1222,14 @@ def main(override=None, intel_for_uc=None, force_uc=None):
zip_file_path,
"-DestinationPath",
downloads_folder,
"-Force",
]
)
else:
zip_ref.extractall(downloads_folder)
zip_ref.close()
os.remove(zip_file_path)
with suppress(Exception):
os.remove(zip_file_path)
log_d("%sUnzip Complete!%s\n" % (c2, cr))
pr_base_path = c3 + base_path + cr
pr_sep = c3 + os.sep + cr
Expand All @@ -1240,7 +1243,7 @@ def main(override=None, intel_for_uc=None, force_uc=None):
driver_path = None
driver_file = None
base_path = os.sep.join(zip_file_path.split(os.sep)[:-1])
folder_name = contents[0].split(os.sep)[0]
folder_name = contents[0].split("/")[0]
folder_path = os.path.join(base_path, folder_name)
if IS_MAC or IS_LINUX:
if (
Expand All @@ -1261,12 +1264,14 @@ def main(override=None, intel_for_uc=None, force_uc=None):
zip_file_path,
"-DestinationPath",
downloads_folder,
"-Force",
]
)
else:
zip_ref.extractall(downloads_folder)
zip_ref.close()
os.remove(zip_file_path)
with suppress(Exception):
os.remove(zip_file_path)
log_d("%sUnzip Complete!%s\n" % (c2, cr))
pr_base_path = c3 + base_path + cr
pr_sep = c3 + os.sep + cr
Expand Down
21 changes: 21 additions & 0 deletions seleniumbase/console_scripts/sb_mkdir.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,27 @@ def main():
data.append("msedgedriver.exe")
data.append("operadriver.exe")
data.append("uc_driver.exe")
data.append("chrome-mac-arm64.zip")
data.append("chrome-mac-x64.zip")
data.append("chrome-linux64.zip")
data.append("chrome-win64.zip")
data.append("chrome-win32.zip")
data.append("chrome-mac-arm64")
data.append("chrome-mac-x64")
data.append("chrome-linux64")
data.append("chrome-win64")
data.append("chrome-win32")
data.append("chrome-headless-shell-mac-arm64.zip")
data.append("chrome-headless-shell-mac-x64.zip")
data.append("chrome-headless-shell-linux64.zip")
data.append("chrome-headless-shell-win64.zip")
data.append("chrome-headless-shell-win32.zip")
data.append("chrome-headless-shell-mac-arm64")
data.append("chrome-headless-shell-mac-x64")
data.append("chrome-headless-shell-linux64")
data.append("chrome-headless-shell-win64")
data.append("chrome-headless-shell-win32")
data.append("libc++.dylib")
data.append("logs")
data.append("latest_logs")
data.append("log_archives")
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@
],
python_requires=">=3.8",
install_requires=[
'pip>=24.3.1',
'pip>=25.0',
'packaging>=24.2',
'setuptools~=70.2;python_version<"3.10"', # Newer ones had issues
'setuptools>=75.8.0;python_version>="3.10"',
Expand Down