Created
November 18, 2018 15:09
-
-
Save goophile/12d9f08d84af815ecc9f97715ee8afe8 to your computer and use it in GitHub Desktop.
Search a list of words and sync to iciba cloud.
This file contains hidden or 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
""" | |
Search a list of words and sync to iciba cloud. | |
This script was tested only on Windows 7. | |
Preparation: | |
1) Install iciba: http://download.iciba.com/pc/personal2016/PowerWord.800.12012.exe | |
2) Install python and pyautogui. | |
3) Move iciba window to a fixed location. | |
4) Find out the coordinates of text input and search button. Change this script according to your needs. | |
Sync: | |
1) In iciba, create a new word list. Change settings to autosave searched words. | |
2) Put all your words in a txt file, one word in one line. | |
3) Run the script: c:\python27\python.exe c:\english\iciba-batch-search.py c:\english\word-list.txt | |
4) Login to iciba, and sync to the cloud or other devices. | |
""" | |
import pyautogui | |
import sys | |
import time | |
# currentMouseX, currentMouseY = pyautogui.position() | |
# print(currentMouseX, currentMouseY) | |
input_xy = (1418, 68) | |
search_xy = (1857, 65) | |
def search(word): | |
pyautogui.moveTo(input_xy) | |
pyautogui.click() | |
pyautogui.press('esc') | |
pyautogui.click() | |
pyautogui.typewrite(word) # type with quarter-second pause in between each key | |
pyautogui.moveTo(search_xy) | |
pyautogui.click() | |
def main(): | |
with open(sys.argv[1]) as f: | |
for word in f.readlines(): | |
search(word) | |
time.sleep(1) | |
main() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment