selenium
lotus通过selenium自动领取测试币
- 系列文章目录
- 前言
- 一、自动领取测试币
- 参考
前言
lotus通过selenium自动领取测试币
一、自动领取测试币
- macos
- faucet.py
from selenium import webdriver
import time
# 创建浏览器对象
driver = webdriver.Chrome()
# 打开浏览器
url = 'https://faucet.calibration.fildev.network/funds.html'
driver.get(url)
time.sleep(2)
# 获取输入框对象
input = driver.find_element_by_xpath("//input[@name='address']")
# 输入内容
input.send_keys("钱包地址")
time.sleep(2)
# 获取点击按钮对象
button = driver.find_element_by_xpath("//div//button[contains(@class,'g-recaptcha')]")
# 点击按钮
button.click()
time.sleep(5)
# 退出浏览器
driver.quit()
参考
- 水龙头
- 尚硅谷Python爬虫教程小白零基础速通(含python基础+爬虫案例)



