-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Drag Iframe Element in CDP Mode #3302
-
Is it possible to drag iframe element in CDP mode?
get_nested_element
retrives element in iframe. But it seems mouse_drag
method does not work with the element
Or is there relative drag method for element in CDP mode?
Beta Was this translation helpful? Give feedback.
All reactions
To drag and drop an element in CDP Mode:
sb.cdp.gui_drag_and_drop(drag_selector, drop_selector)
Example in examples/cdp_mode/raw_demo_site.py
Replies: 1 comment 2 replies
-
To drag and drop an element in CDP Mode:
sb.cdp.gui_drag_and_drop(drag_selector, drop_selector)
Example in examples/cdp_mode/raw_demo_site.py
Beta Was this translation helpful? Give feedback.
All reactions
-
-
There are no examples of drag and drop inside an iframe there.
-
This does not work
handle = sb.cdp.get_nested_element(iframe, hadle_selector) position = handle.get_position() x1, y1 = position.x, position.y x2, y2 = x1 + 50, y1, sb.cdp.gui_drag_drop_points(x1, y1, x2, y2)
- What if the element doesn't exist in the destination?
How do I move the starting point by x and y pixels relative to the destination?
Beta Was this translation helpful? Give feedback.
All reactions
-
You'll have to use sb.cdp.gui_drag_drop_points(x1, y1, x2, y2)
and determine the coordinates yourself.
Beta Was this translation helpful? Give feedback.