app爬虫appium获取借贷宝,无忧等等(控制文件)

本文介绍如何使用Appium进行多线程控制,通过CMD连接Appium Server并操控模拟器上的借贷宝、无忧等应用。利用Redis管道监控多App登录和数据搜索,避免检测。一台Appium Server对应一台模拟器,资源需求较高,8GB内存电脑最多运行3个模拟器。

上文介绍了部分配置,本文主要是写多线程开启cmd,连接appium server,联动模拟器上的app。讲解多app登录账户分配,多模拟器上不同app搜索数据分配问题。主要是采取redis管道监控

主要的思路是一台appium_server对应一台模拟器或手机,一个机器运行的不同的app,以规避检测。目前模拟器端已实现,只是资源太重8g内存电脑只能运行3个左右模拟器再多就会cpu爆满
上代码:
1导模块

import time
#这些是我自己文件配饰好的
from appium_config import Appium_Configs        #appium配置文件
from jietiao import appiumMainTest              #app1的文件
from jtapp import jtMainTest                    #app2的文件
from jdb1 import jdbMainTest                    #app3的文件
from sql import Sql_all                         #sql文件之前文章有介绍
import threading

2初始化,主要是一些导包

app_count =-1#该参数必须共享才能在不同线程的永真循环保证同时单模拟器不一样的app运行
class Agoda(threading.Thread):
    __pool = None
    _instance_lock = threading.Lock()
    def __init__(self,port, udid,threadID, name, counter):
        threading.Thread.__init__(self)
        self.threadID = threadID
        self.
回答: Appium是一个源的自动化测试工具,也可以用于进行移动应用程序的爬虫。使用Appium可以模拟用户在移动设备上的操作,比如点击、滑动等,从而获取移动应用程序中的数据。具体的操作步骤如下: 1. 在Windows虚拟环境下执行`pip install appium-python-client`命令,安装appium-python-client模块。 2. 启动夜神模拟器,并使用adb命令建立adb server和模拟器的连接。 3. 启动appium-desktop,点击start server启动appium服务。 4. 根据需要获取移动设备的型号、app包名称和进程名,可以通过adb shell命令获取。 5. 初始化并获取移动设备的分辨率。 6. 使用appium-python-client模块编写代码,实现控制移动应用程序进行相关操作,比如滑动、获取信息等。 以上是使用Appium进行移动应用程序爬虫的一般步骤,具体的实现还需要根据具体的应用程序和需求进行调整和编码。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [《Python爬虫100例》复盘⑦,解决手机APP爬虫环境问题](https://blog.youkuaiyun.com/hihell/article/details/121289717)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"] - *2* *3* [APP爬虫--appium提取数据](https://blog.youkuaiyun.com/qq_45176548/article/details/113200918)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]
评论 7
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值