Created
September 18, 2018 00:25
-
-
Save NathanLovato/313820bad6d312c6552ad75b1020dba0 to your computer and use it in GitHub Desktop.
Pyautogui script to add redirects in batch in the Godot docs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Pyautogui script to add redirects in batch in the Godot docs | |
""" | |
import pyautogui | |
import time | |
replace = { | |
"/old/url": "/new/url", | |
"/community/tutorials/3d/inverse_kinematics.html": "/tutorials/3d/inverse_kinematics.html", #example | |
} | |
pyautogui.moveTo(200, 200) | |
pyautogui.click() | |
for old_url in replace: | |
pyautogui.hotkey('ctrl', 'f') | |
pyautogui.typewrite('Redirect Type:') | |
pyautogui.press('enter') | |
pyautogui.press('esc') | |
pyautogui.press('tab') | |
pyautogui.press(['down', 'down']) | |
pyautogui.press('tab') | |
pyautogui.typewrite(old_url) | |
pyautogui.press('tab') | |
pyautogui.typewrite(replace[old_url]) | |
pyautogui.press('tab') | |
pyautogui.press('enter') | |
while pyautogui.pixel(100, 80) != (68, 74, 77): | |
time.sleep(0.2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment