appium连接微信,并且输入微信账号

 环境:打开手机的管理人员调试,电脑配制好安卓,java环境

 代码: 

from appium import webdriver
from selenium.webdriver.support.ui import WebDriverWait

# 手机的链接
server = 'http://localhost:4723/wd/hub'

# 配置连接手机的参数
desired_caps = {
    "platformName": "Android",
    "deviceName": "COL_AL10",
    "appPackage": "com.tencent.mm",
    "appActivity": ".ui.LauncherUI"
}

# 链接参数,进行驱动
driver = webdriver.Remote(server, desired_caps)

# 以下是appium自动生成的代码
el2 = driver.find_element_by_id("com.tencent.mm:id/ene")
el2.click()

el3 = driver.find_element_by_id("com.tencent.mm:id/m7")
el3.send_keys("15237226879")

 

你可能感兴趣的:(爬虫进阶)