|
1 | | -# Selenium-Profiles V2 |
| 1 | +# Selenium-Profiles |
2 | 2 |
|
3 | 3 | * Overwrite **device metrics** using Selenium |
4 | 4 | * Mobile and Desktop **emulation** |
5 | 5 | * **Undetected** by Google, Cloudflare, .. |
6 | 6 | * [Modifying headers](#Modify-headers) supported using [Selenium-Interceptor](https://github.com/kaliiiiiiiiii/Selenium-Interceptor) |
| 7 | +* [Touch Actions](#Touch_actions) |
7 | 8 |
|
8 | 9 | for the latest features, have a look at the `dev`branch |
9 | 10 |
|
@@ -125,6 +126,45 @@ driver.get("https://modheader.com/headers?product=ModHeader") |
125 | 126 | Don't forget to execute |
126 | 127 | `cdp_listener.terminate_all()` |
127 | 128 |
|
| 129 | +### Touch_actions |
| 130 | + |
| 131 | +Example demonstration script |
| 132 | +```python |
| 133 | +from selenium_profiles.driver import driver as mydriver |
| 134 | +from selenium_profiles.profiles import profiles |
| 135 | + |
| 136 | +from selenium_profiles.scripts.touch_actions import touch_action_chain, mid_location |
| 137 | + |
| 138 | +from selenium.webdriver.common.by import By |
| 139 | + |
| 140 | + |
| 141 | +# Start Driver |
| 142 | +mydriver = mydriver() |
| 143 | +profile = profiles.Android() |
| 144 | +driver = mydriver.start(profile, uc_driver=False) # or .Android |
| 145 | + |
| 146 | +# initialise touch_actions |
| 147 | +touch_actions = touch_action_chain(driver) |
| 148 | + |
| 149 | +driver.get("https://cps-check.com/de/multi-touch-test") |
| 150 | + |
| 151 | +touch_box = driver.find_element(By.XPATH,'//*[@id="box"]') # Get element |
| 152 | +location = mid_location(touch_box) # get element middle location |
| 153 | + |
| 154 | +# setup actions |
| 155 | +touch_actions.pointer_action.move_to_location(location['x'],location['y']) |
| 156 | +touch_actions.pointer_action.pointer_down() |
| 157 | + |
| 158 | +# perform actions |
| 159 | +touch_actions.perform() |
| 160 | + |
| 161 | +# now you should see a touch indication point on the Website |
| 162 | + |
| 163 | +# quit driver |
| 164 | +input('Press ENTER to quit Driver\n') |
| 165 | +driver.quit() |
| 166 | +``` |
| 167 | + |
128 | 168 | ### To export a profile: |
129 | 169 |
|
130 | 170 | go to [https://js.do/kaliiiiiiiiiii/get_profile](https://js.do/kaliiiiiiiiiii/get_profile) in your browser and copy the text. |
|
0 commit comments