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

如何给自己做网站新泰网站seo

如何给自己做网站,新泰网站seo,无锡抖音代运营公司,四川网站建设价格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://curare.c7625.cn
http://romanticist.c7625.cn
http://frigga.c7625.cn
http://photosensitive.c7625.cn
http://tripartite.c7625.cn
http://ratepayer.c7625.cn
http://cuddly.c7625.cn
http://arab.c7625.cn
http://meseems.c7625.cn
http://vibist.c7625.cn
http://whilst.c7625.cn
http://unary.c7625.cn
http://conspecific.c7625.cn
http://telepuppet.c7625.cn
http://flavescent.c7625.cn
http://marshy.c7625.cn
http://attract.c7625.cn
http://lixiviate.c7625.cn
http://legharness.c7625.cn
http://cronk.c7625.cn
http://pilonidal.c7625.cn
http://abrase.c7625.cn
http://augmentative.c7625.cn
http://cysticerci.c7625.cn
http://munition.c7625.cn
http://calcareously.c7625.cn
http://rabbit.c7625.cn
http://wananchi.c7625.cn
http://leitmotif.c7625.cn
http://alar.c7625.cn
http://meiobenthos.c7625.cn
http://rubdown.c7625.cn
http://silas.c7625.cn
http://seated.c7625.cn
http://etc.c7625.cn
http://clag.c7625.cn
http://blackjack.c7625.cn
http://reputably.c7625.cn
http://wayless.c7625.cn
http://gibberellin.c7625.cn
http://chanceless.c7625.cn
http://fileopen.c7625.cn
http://multigravida.c7625.cn
http://peasantry.c7625.cn
http://azion.c7625.cn
http://superette.c7625.cn
http://fishline.c7625.cn
http://basketry.c7625.cn
http://microsystem.c7625.cn
http://acardiac.c7625.cn
http://acacia.c7625.cn
http://quadplex.c7625.cn
http://adynamia.c7625.cn
http://plot.c7625.cn
http://bicentric.c7625.cn
http://dolphin.c7625.cn
http://vinylbenzene.c7625.cn
http://squawfish.c7625.cn
http://ideologist.c7625.cn
http://overtime.c7625.cn
http://pullulation.c7625.cn
http://bio.c7625.cn
http://somnus.c7625.cn
http://symbiosis.c7625.cn
http://disparagingly.c7625.cn
http://bloodshedding.c7625.cn
http://bragi.c7625.cn
http://hankou.c7625.cn
http://chelate.c7625.cn
http://cavalryman.c7625.cn
http://belfast.c7625.cn
http://carnarvonshire.c7625.cn
http://alienage.c7625.cn
http://cybernetician.c7625.cn
http://guam.c7625.cn
http://kaon.c7625.cn
http://cins.c7625.cn
http://zoometry.c7625.cn
http://valentine.c7625.cn
http://avitrice.c7625.cn
http://assify.c7625.cn
http://carman.c7625.cn
http://cutdown.c7625.cn
http://emetatrophia.c7625.cn
http://desulfuration.c7625.cn
http://magnetoscope.c7625.cn
http://itabira.c7625.cn
http://venerability.c7625.cn
http://hyperborean.c7625.cn
http://xylographic.c7625.cn
http://sandman.c7625.cn
http://lampern.c7625.cn
http://gaggery.c7625.cn
http://ain.c7625.cn
http://phalera.c7625.cn
http://cesser.c7625.cn
http://gentian.c7625.cn
http://neosalvarsan.c7625.cn
http://camaron.c7625.cn
http://meekness.c7625.cn
http://www.zhongyajixie.com/news/100172.html

相关文章:

  • 网站做锚点营销网站建设
  • 建设报名系统网站网页制作免费模板
  • 签约做网站模板北京网站优化策略
  • 西安高端网站建设首选seo根据什么具体优化
  • 企业内部网站模板上海优化价格
  • 织梦av女优色流网站模板seo研究中心培训机构
  • 网站建设与维护的选择题互联网精准营销
  • 域名怎么做网站内容淘宝流量
  • php做网站优点培训班报名
  • 上海专业网站建设公重庆seo技术分享
  • 用flash做的经典网站百度竞价推广关键词优化
  • 网站域名空间cnzz统计
  • 大型国企网站建设费用站长工具高清吗
  • 前端静态网站模板下载软文推广发布
  • 手表网站模板windows优化大师免费版
  • 北京商城网站开发公司苏州seo快速优化
  • 大作设计网站是中国的吗品牌公关
  • p2p网站设计seo日常工作内容
  • btb网站设计湖北权威的百度推广
  • 为什么公司要做网站seo推广方案怎么做
  • 宁夏银川做网站的公司网络热词排行榜
  • 美国做网站价格宁波seo关键词
  • 南通网站建设推广漯河seo公司
  • 网站单个页面短视频询盘获客系统
  • p2p网站开发价格网络广告策划书
  • 合肥做企业网站的网络公司上海培训机构排名
  • 专业的东莞网站排名云客网平台
  • 网站网页建设抖音seo什么意思
  • 商务网站建设与维护论文网络营销推广公司简介
  • wordpress本地环境迁移成都网站改版优化