MCPcopy Index your code
hub / github.com/wistbean/learn_python3_spider / start_drag

Function start_drag

fuck_bilibili_captcha.py:103–123  ·  view source on GitHub ↗
(driver, distance)

Source from the content-addressed store, hash-verified

101
102
103def start_drag(driver, distance):
104
105 # 被妖怪吃掉了
106 # knob = WAIT.until(EC.presence_of_element_located((By.CSS_SELECTOR, "#gc-box > div > div.gt_slider > div.gt_slider_knob.gt_show")))
107 # ActionChains(driver).click_and_hold(knob).perform()
108 # ActionChains(driver).move_by_offset(xoffset=distance, yoffset=0.1).perform()
109 # time.sleep(0.5)
110 # ActionChains(driver).release(knob).perform()
111
112 # 被妖怪吃掉了
113 # ActionChains(driver).drag_and_drop_by_offset(knob, distance-10, 0).perform()
114
115 knob = WAIT.until(EC.presence_of_element_located((By.CSS_SELECTOR, "#gc-box > div > div.gt_slider > div.gt_slider_knob.gt_show")))
116 result = get_path(distance)
117 ActionChains(driver).click_and_hold(knob).perform()
118
119 for x in result:
120 ActionChains(driver).move_by_offset(xoffset=x, yoffset=0).perform()
121
122 time.sleep(0.5)
123 ActionChains(driver).release(knob).perform()
124
125
126def recognize_code(driver):

Callers 1

recognize_codeFunction · 0.85

Calls 1

get_pathFunction · 0.85

Tested by

no test coverage detected