Skip to content

Commit 5d1e5fb

Browse files
committed
Add CDP Mode to UC Mode
1 parent e6e3c97 commit 5d1e5fb

23 files changed

+6396
-114
lines changed

help_docs/method_summary.md

+4
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,8 @@ self.remove_attribute(selector, attribute, by="css selector", timeout=None)
125125

126126
self.remove_attributes(selector, attribute, by="css selector")
127127

128+
self.internalize_links()
129+
128130
self.get_property(selector, property, by="css selector", timeout=None)
129131

130132
self.get_text_content(selector="html", by="css selector", timeout=None)
@@ -134,6 +136,8 @@ self.get_property_value(selector, property, by="css selector", timeout=None)
134136
self.get_image_url(selector, by="css selector", timeout=None)
135137

136138
self.find_elements(selector, by="css selector", limit=0)
139+
# Duplicates:
140+
# self.select_all(selector, by="css selector", limit=0)
137141

138142
self.find_visible_elements(selector, by="css selector", limit=0)
139143

seleniumbase/common/decorators.py

+8-7
Original file line numberDiff line numberDiff line change
@@ -43,23 +43,24 @@ def my_method():
4343
finally:
4444
end_time = time.time()
4545
run_time = end_time - start_time
46+
name = description
4647
# Print times with a statistically significant number of decimal places
4748
if run_time < 0.0001:
48-
print(" {%s} ran for %.7f seconds." % (description, run_time))
49+
print("<info> - {%s} ran for %.7f seconds." % (name, run_time))
4950
elif run_time < 0.001:
50-
print(" {%s} ran for %.6f seconds." % (description, run_time))
51+
print("<info> - {%s} ran for %.6f seconds." % (name, run_time))
5152
elif run_time < 0.01:
52-
print(" {%s} ran for %.5f seconds." % (description, run_time))
53+
print("<info> - {%s} ran for %.5f seconds." % (name, run_time))
5354
elif run_time < 0.1:
54-
print(" {%s} ran for %.4f seconds." % (description, run_time))
55+
print("<info> - {%s} ran for %.4f seconds." % (name, run_time))
5556
elif run_time < 1:
56-
print(" {%s} ran for %.3f seconds." % (description, run_time))
57+
print("<info> - {%s} ran for %.3f seconds." % (name, run_time))
5758
else:
58-
print(" {%s} ran for %.2f seconds." % (description, run_time))
59+
print("<info> - {%s} ran for %.2f seconds." % (name, run_time))
5960
if limit and limit > 0 and run_time > limit:
6061
message = (
6162
"\n {%s} duration of %.2fs exceeded the time limit of %.2fs!"
62-
% (description, run_time, limit)
63+
% (name, run_time, limit)
6364
)
6465
if exception:
6566
message = exception.msg + "\nAND " + message

seleniumbase/console_scripts/sb_install.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -811,7 +811,7 @@ def main(override=None, intel_for_uc=None, force_uc=None):
811811
zip_ref.extractall(downloads_folder)
812812
zip_ref.close()
813813
os.remove(zip_file_path)
814-
shutil.copyfile(driver_path, os.path.join(downloads_folder, filename))
814+
shutil.copy3(driver_path, os.path.join(downloads_folder, filename))
815815
log_d("%sUnzip Complete!%s\n" % (c2, cr))
816816
to_remove = [
817817
"%s/%s/ruby_example/Gemfile" % (downloads_folder, h_ie_fn),
@@ -953,7 +953,7 @@ def main(override=None, intel_for_uc=None, force_uc=None):
953953
)
954954
if copy_to_path and os.path.exists(LOCAL_PATH):
955955
path_file = LOCAL_PATH + f_name
956-
shutil.copyfile(new_file, path_file)
956+
shutil.copy2(new_file, path_file)
957957
make_executable(path_file)
958958
log_d("Also copied to: %s%s%s" % (c3, path_file, cr))
959959
log_d("")
@@ -1042,7 +1042,7 @@ def main(override=None, intel_for_uc=None, force_uc=None):
10421042
)
10431043
if copy_to_path and os.path.exists(LOCAL_PATH):
10441044
path_file = LOCAL_PATH + f_name
1045-
shutil.copyfile(new_file, path_file)
1045+
shutil.copy2(new_file, path_file)
10461046
make_executable(path_file)
10471047
log_d("Also copied to: %s%s%s" % (c3, path_file, cr))
10481048
log_d("")
@@ -1078,7 +1078,7 @@ def main(override=None, intel_for_uc=None, force_uc=None):
10781078
)
10791079
if copy_to_path and os.path.exists(LOCAL_PATH):
10801080
path_file = LOCAL_PATH + f_name
1081-
shutil.copyfile(new_file, path_file)
1081+
shutil.copy2(new_file, path_file)
10821082
make_executable(path_file)
10831083
log_d("Also copied to: %s%s%s" % (c3, path_file, cr))
10841084
log_d("")

0 commit comments

Comments
 (0)