This is a Python Script based on Selenium for automated searching through the Pokemon Go's Wayfarer Portal. The goal is to find a certain review (or multiple) based on the title to give it a certain rating. This project is only for demonstrating the power of UI testing with Selenium. Do not use this program extensively as your account maybe banned!
The script is by far not a perfect masterpiece, because it doesn't handle all special cases and it doesn't use xpath -> Therefore feel free to place a merge request.
Download:
- Python 3 and add it to PATH
- the chromedriver (only if you need a newer version)
- and the chrome browser version 83 itself
In the browser - log in and activate sync - restart and see if sync is paused.
If sync is still paused type chrome://settings/content/cookies
into the search bar and whitelist accounts.google.com
- Syncing should work now.
- Open up a command prompt in the folder of this script and
pip install selenium
If you get an error saying that it does not know pip, restart your machine and try again.
- Open up the
AutoWayfarer.py
file in a text editor and change the name of the submissions
mySubmissions = ["title1", "title2"]
you want to search for as well as the path to your Google Chrome Profile
options.add_argument("--user-data-dir=C:/Users/YOURNAME/AppData/Local/Google/Chrome/User Data")
options.add_argument("--profile-directory=Default")
then safe and close.
- In your opened command prompt type:
python ./AutoWayfarer.py
- The first time you do this selenium will open with a guest account and fail. Cancel the script and close chrome.
- Now you have a directory named "Profile 2" under the User Data directory of Chrome. Copy all files of the "Default" directory to the "Profile 2" directory and restart the script. By now you have set it all up and you can relaunch it whenever you want.
- To stop the script from running press
Control + C
- Refactor using xpath?
Special cases are somewhat handled with a timeout to move on and to not break the script
- Special cases:
- Determine closest position
- Determine best titel
- "What is this card about (Required)" (h4 class: card-header__title) -> needs to be chosen