-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
-
Problem Description
When using sb.type("textarea.c-jOMmSw", prompt)
from SeleniumBase, inserting large HTML text (like prompt2
in the code below) is significantly slower compared to shorter texts (like prompt1
). The delay occurs specifically when the prompt contains lengthy HTML content, despite the function working instantly for smaller inputs. This impacts automation efficiency when dealing with large data inputs.
Code Example
from seleniumbase import SB def generate_response(prompt): with SB(uc=True) as sb: sb.open("https://build.nvidia.com/deepseek-ai/deepseek-r1-0528") # Slow with large HTML text (prompt2), fast with short text (prompt1) sb.type("textarea.c-jOMmSw", prompt) # Delay occurs here for big HTML # ... additional logic for handling responses prompt1 = "Your question here" # Fast insertion prompt2 = "```<div><p>...</p></div>```" # Large HTML content - slow insertion
Expected vs Actual Behavior
- Expected:
sb.type()
should insert text quickly regardless of content size. - Actual:
- Short text (e.g.,
prompt1
): Instant insertion. - Large HTML text (e.g.,
prompt2
): Takes significantly longer to complete.
- Short text (e.g.,
Environment
- SeleniumBase Version: latest version.
- OS: Linux and Windows (issue on both)
Question
Are there way to accelerate sb.type()
for large content?
Beta Was this translation helpful? Give feedback.
All reactions
You could try sb.cdp.set_value(selector, text)
if sb.cdp.type(selector, text)
isn't fast enough for you. Keep in mind that UC Mode / CDP Mode is about bypassing bot-detection, not about going as quickly as possible (which makes you look like a bot).
Replies: 1 comment
-
You could try sb.cdp.set_value(selector, text)
if sb.cdp.type(selector, text)
isn't fast enough for you. Keep in mind that UC Mode / CDP Mode is about bypassing bot-detection, not about going as quickly as possible (which makes you look like a bot).
Beta Was this translation helpful? Give feedback.