平时撸毛有很多小号,偶尔需要在浏览器手动操作,这个脚本可以帮忙批量导入metamask,进行一些简单的重复操作。代码其实比较简单,就是环境准备比较麻烦,selenium操作一般就是定位元素,输入数据,点击按钮
selenium 4的语法和之前3差别很多,注意版本
https://chromedriver.storage.googleapis.com/index.html
https://chromedriver.chromium.org/downloads
https://googlechromelabs.github.io/chrome-for-testing/#stable
C:\Users\自己的用户名\AppData\Local\Google\Chrome\User Data
最好自己复制一份,方便调试
C:\Users\自己的用户名\AppData\Local\Google\Chrome\User Data1
"C:\Program Files\Google\Chrome\Application\chrome.exe" --profile-directory="Profile 10" --user-data-dir="C:\Users\自己的用户名\AppData\Local\Google\Chrome\User Data1" --remote-debugging-port=9222
pip install selenium
python py-selenium-metamask.py
browser.find_element(By.XPATH,'')