-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
UC Mode / CDP ModeUndetected Chromedriver Mode / CDP ModeUndetected Chromedriver Mode / CDP ModebugUh oh... Something needs to be fixedUh oh... Something needs to be fixedworkaround existsYou can reach your destination if you do this...You can reach your destination if you do this...
Description
Bug: Missing Argument in get_element_attribute Method in get_attributeFile: fixtures/base_case.py
Description
The get_attribute method contains an error in the following code snippet:
if self.__is_cdp_swap_needed():
return self.cdp.get_element_attribute(selector)The get_element_attribute method from CDPMethods is missing a required positional argument: 'attribute'. This results in the following error:
TypeError: CDPMethods.get_element_attribute() missing 1 required positional argument: 'attribute'Expected Behavior
The method should pass the attribute argument to get_element_attribute to retrieve the correct attribute value.
Current Behavior
The attribute argument is not being passed, leading to a TypeError.
Steps to Reproduce
- Use the following test setup:
with SB(uc=True, incognito=True, test=True, locale_code="en") as sb:
sb.activate_cdp_mode("about:blank")
sb.uc_open_with_reconnect("https://seleniumbase.io/apps/turnstile", 8)
response_value = sb.get_attribute('input[name="cf-turnstile-response"]', 'value')- Observe the
TypeErrorwhen the method is invoked.
Proposed Fix
Update the code to correctly pass the attribute argument:
if self.__is_cdp_swap_needed():
return self.cdp.get_element_attribute(selector, attribute)Metadata
Metadata
Assignees
Labels
UC Mode / CDP ModeUndetected Chromedriver Mode / CDP ModeUndetected Chromedriver Mode / CDP ModebugUh oh... Something needs to be fixedUh oh... Something needs to be fixedworkaround existsYou can reach your destination if you do this...You can reach your destination if you do this...