当前位置: 首页 > news >正文

如何给自己做网站最近比较火的关键词

如何给自己做网站,最近比较火的关键词,公众号开通小程序,2个淘宝可以做情侣网站么0.使用inspector时,一定要把不相关的如weditor啥的退出去,否则,净是事。 1.从0开始的数据获取 第一个位置,有时0.0.0.0,不可以的话,你就用这个。 第二个位置,抄上。 直接点击第三个启动。不要…

0.使用inspector时,一定要把不相关的如weditor啥的退出去,否则,净是事。

1.从0开始的数据获取

 第一个位置,有时0.0.0.0,不可以的话,你就用这个。

第二个位置,抄上。

直接点击第三个启动。不要问为什么,问就是。我也不知道。

第一个错误:它说得有个平台名,好吧。

错误
Failed to create session. An unknown server-side error occurred while processing the command. Original error: You must include a platformName capability

添上

注意一定要添上如下

"appium:automationName": "UiAutomator2"

再次启动。OK了进来了。

 再次提醒,版本不一样,出错不一样,你根据出错的地方完善就可以。

2.获取某团相关

 自动点击手机上的某团,打开它。

 一个一个的点复制。

'getCurrentActivity' "com.meituan.android.pt.homepage.activity.MainActivity"
'getCurrentPackage' "com.sankuai.meituan"

 返回修改

{"appium:platformName": "Android","appium:automationName": "UiAutomator2","appium:appPackage": "com.sankuai.meituan","appium:appActivity": "com.meituan.android.pt.homepage.activity.MainActivity"
}

 其他信息模仿吧。

通过adb获取信息

C:\Users\Administrator>adb shell dumpsys activity | findstr "mResume"mResumedActivity: ActivityRecord{1fef505 u0 com.sankuai.meituan/com.meituan.android.pt.homepage.activity.MainActivity t1097}

 形成测试代码:


from appium import webdriver
from appium.options.android import UiAutomator2Options
desired_caps = {"platformName": "Android","platformVersion": "10","deviceName": "Q5X7N19605002672","appium:appPackage": "com.sankuai.meituan","appium:appActivity": "com.meituan.android.pt.homepage.activity.MainActivity","unicodeKeyboard": True,"resetKeyboard":True,"noReset":True,"appium:newCommandTimeout": 6000,"appium:automationName": "UiAutomator2"
}if desired_caps is not None:driver = webdriver.Remote('http://127.0.0.1:4723/wd/hub', options=UiAutomator2Options().load_capabilities(desired_caps))
else:raise ValueError("desired_caps must not be None")

 运行成功。

用inspector进行附加。

利用代码启动某团,一定要利用pycharm中的代码进行,否则无效,原理很简单。就是通过appium互动留下的信息进行启动的。

再次刷新附加

界面示例:

3.点击某个元素、输入文本、搜索等。

点击超市便利为例:

 

 有一个结果,点击一下。看手机是否正常反映

有反映,记录之

(//android.widget.ImageView[@resource-id="com.sankuai.meituan:id/channel_icon"])[5]

 输入商店名称进行搜索:以下记得刷新,否则你明白 的。信息不准。

方法同上。

输入框定位后,点击一下。

//android.widget.LinearLayout[@resource-id="com.sankuai.meituan:id/minutes_animte_action_search"]/android.widget.LinearLayout[1]

进入新窗口

通过应用源一级级定位到最低级的编辑框位置。输入想要搜索的关键词。

//android.widget.EditText[@resource-id="com.sankuai.meituan:id/txt_search_keyword"]

如下图:

定位搜索按钮。

//android.widget.LinearLayout[@resource-id="com.sankuai.meituan:id/search_tv"]

来到以下页面。

点击排名第一个商店,进入商店 

 通过应用源一级级的定位,不再多说。

(//android.widget.FrameLayout[@resource-id="com.sankuai.meituan:id/mach_container_wrapper"])[2]

来到如图:

4.根据以上查证结果,生成py文件,进行自动操作。

提醒,以上其实是XPATH定位,不是最推荐的,但目前,用这个就行。

 以下代码,完整无伤通过。


from appium import webdriver
from appium.options.android import UiAutomator2Options
desired_caps = {"platformName": "Android","platformVersion": "10","deviceName": "Q5X7N19605002672","appium:appPackage": "com.sankuai.meituan","appium:appActivity": "com.meituan.android.pt.homepage.activity.MainActivity","unicodeKeyboard": True,"resetKeyboard":True,"noReset":True,"appium:newCommandTimeout": 6000,"appium:automationName": "UiAutomator2"
}driver = webdriver.Remote('http://127.0.0.1:4723/wd/hub', options=UiAutomator2Options().load_capabilities(desired_caps))# 设置超时时间和重试间隔
timeout = 10
poll_frequency = 1
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC####################### 点击超市便利########################################################element = WebDriverWait(driver, timeout, poll_frequency).until(EC.element_to_be_clickable((By.XPATH, '(//android.widget.ImageView[@resource-id="com.sankuai.meituan:id/channel_icon"])[5]'))
)
element.click()
######################### 点击搜索框########################################################
element = WebDriverWait(driver, timeout, poll_frequency).until(EC.element_to_be_clickable((By.XPATH, '//android.widget.LinearLayout[@resource-id="com.sankuai.meituan:id/minutes_animte_action_search"]/android.widget.LinearLayout[1]'))
)
element.click()
##################### 使用显式等待定位并输入文本############################################################
try:search_box = WebDriverWait(driver, timeout, poll_frequency).until(EC.presence_of_element_located((By.XPATH, "//android.widget.EditText[@resource-id='com.sankuai.meituan:id/txt_search_keyword']")))search_box.send_keys("优小优")
except Exception as e:print(f"无法找到或操作元素: {e}")########################## 点击搜索按钮#########################################################element = WebDriverWait(driver, timeout, poll_frequency).until(EC.element_to_be_clickable((By.XPATH, '//android.widget.LinearLayout[@resource-id="com.sankuai.meituan:id/search_tv"]'))
)
element.click()########################## 点击排名第一的商店#########################################################element = WebDriverWait(driver, timeout, poll_frequency).until(EC.element_to_be_clickable((By.XPATH, '(//android.widget.FrameLayout[@resource-id="com.sankuai.meituan:id/mach_container_wrapper"])[2]'))
)
element.click()

 

 希望你也能一次无伤通过。

下一节,打算获取其商品数据。并保存之。 

http://www.yidumall.com/news/16662.html

相关文章:

  • 网站建设功能新浪微舆情大数据平台
  • wordpress标签中文404百度seo规则最新
  • 做渲染的网站外贸建站服务推广公司
  • vx小程序怎么做最新seo新手教程
  • 深圳响应式网站价格免费h5制作网站
  • 在网站建设中要注意的问题全国疫情最新情况公布
  • 网站字体选择今日热搜新闻头条
  • 上海做网站建设公司seo推广专员
  • 做影视网站对服务器要求名片seo什么意思
  • 赣州企业网站建设指数基金定投技巧
  • 广州网站开发设计什么是网站优化
  • as3 xml 网站模板 下载seo教程搜索引擎优化
  • wordpress 极简 h5深圳网站优化推广
  • 专做冷冻食品批发的网站百度免费发布信息网站
  • 邯郸哪家公司做企业网站比较专业交换友情链接
  • 东莞封了几个镇关键词排名优化是什么意思
  • 品牌网站建设有那两种模式推广拉新app哪几个靠谱
  • 手机网站建设需要多少钱做引流推广的平台
  • 互联网网站建设价格seo排名规则
  • 杭州做网站的好公司快速网络推广
  • 企业网站管理系统毕业论文优化seo可以从以下几个方面进行
  • 中国视觉设计网站沧州网站优化公司
  • 上海做网站比较有名的公司宁波seo外包方案
  • 大型车产品网站建设专业搜索引擎seo公司
  • 凡科网站怎么做外链seo系统教程
  • 番禺网站开发百度一下网页版
  • 品网站建设网站信息查询
  • 视频网站很难建设吗爱战网官网
  • 新乡做企业网站的公司广告网站建设网站排名优化
  • 做电影网站多少钱seo专业培训班