硒 whatsapp 按钮搜索 vba [英] selenium whatsapp button search vba

查看:44
本文介绍了硒 whatsapp 按钮搜索 vba的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个大问题!!!正常使用几天后突然无法选择web whatsapp的按钮键号!

环境是 Chrome,我使用 Selenium 网络驱动程序......我正在尝试对不同的标签进行所有搜索,但什么都没有......

这是代码

bot.wait 4000bot.findElementByClassName("C28xL").点击

我也尝试过使用不同的部分,但什么都没有……即使使用 xpath 或 css,但也许我错了.

<小时>

按钮搜索 whatsapp 网站

选择按钮.

<div class="gQzdc"><button class="C28xL"><div class="_1M3wR _1BC4w"><span class="" data-icon="back-blue"><svg id="Layer_1" xmlns="http://www.w3.org/2000/svg" viewBox="0 024 24" width="24" height="24"><path fill="#4FC3F7" d="M20 11H7.8l5.6-5.6L12 4l-8 8 8 8 1.4-1.4L7.8 13H20v-2z"></path></svg></span></div><div class="_1M3wR _3M2St"><span class=""data-icon="search">;<svg id="Layer_1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><路径填充="#263238" fill-opacity=".3" d="M15.009 13.805h-.636l-.22-.219a5.184 5.184 0 0 0 1.256-3.386 5.207 5.207 5.210 .310 .300 0 3.385-1.255l.221.22v.635l4.004 3.999 1.194-1.195-3.997-4.007zm-4.808 0a3.605 3.605 0 1 . 1 03-76; . & 1 . 1 0 0 7 0 0 1 . 1 0 76</svg></span></div></button><span></span><div class="_2cLHw">Cerca o inizia una nuova chat</div><label class="_2MSJr"><input value="" title="Cerca o inizia una nuova chat" dir="auto" data-tab="2" class="jN-F5 copyable-text selectable-text" type="text"></label></div>

<小时>

页面更多 html 的屏幕截图:

<button class="C28xL"><div class="_1M3wR _1BC4w"><span class="" data-icon="back-blue"><svg id="Layer_1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="#4FC3F7" d="M20 11H7.8l5.6-5.6L12 4l-8 8 8 8 1.4-1.4L7.8 13H20v-2z"></path></svg></span>

<div class="_1M3wR _3M2St"><span class="" data-icon="search"><svg id="Layer_1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="#263238" fill-opacity=".3" d="M15.009 13.805h-.636l-.22-.219a5.184 5.184 0 0 0 1.256-3.386 5.207 5.207 0.2075.208 5.183 5.183 0 0 0 3.385-1.255l.221.22v.635l4.004 3.999 1.194-1.195-3.997-4.007zm-4.808 0a3.605 3.605 0 1 1 0-7.21 3.605 3.605 0 0 1 0 7.21z></路径></svg></span>

<跨度></span><div class="_2cLHw">Cerca o inizia una nuova chat</div><label class="_2MSJr"><input value="" title="Cerca o inizia una nuova chat" dir="auto" data-tab="2" class="jN-F5 copyable-text selectable-text" type="text">

<小时>

直到周五一切都很好.我还更新了 2.42 的 webdriver,chrome 更新到了 69.我该怎么办?

解决方案

根据 HTML 你分享的元素是一个 动态元素 所以你必须诱导 等待元素可点击,您可以使用以下解决方案:

bot.wait 4000bot.FindElementByXPath("//input[contains(@class,'copyable-text selectable-text') and @title='Cerca o inizia una nuova chat']").点击

注意:作为一项增强功能,您需要通过 WebDriverWait

替换 wait

I have a big problem !!! After a few days of normal use suddenly I can no longer select the button key number of web whatsapp!

The environment is Chrome and I use Selenium web driver ... I'm trying to do all the searches for different tags but nothing ...

This is the code

bot.wait 4000       
bot.findElementByClassName("C28xL").Click

I also tried using different parts but nothing ... even with xpath or css but maybe I'm wrong.


button search whatsapp web

Button to select.

<div class="gQzdc"><button class="C28xL"><div class="_1M3wR _1BC4w"><span class="" data-icon="back-blue"><svg id="Layer_1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="#4FC3F7" d="M20 11H7.8l5.6-5.6L12 4l-8 8 8 8 1.4-1.4L7.8 13H20v-2z"></path></svg></span></div><div class="_1M3wR _3M2St"><span class="" data-icon="search"><svg id="Layer_1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="#263238" fill-opacity=".3" d="M15.009 13.805h-.636l-.22-.219a5.184 5.184 0 0 0 1.256-3.386 5.207 5.207 0 1 0-5.207 5.208 5.183 5.183 0 0 0 3.385-1.255l.221.22v.635l4.004 3.999 1.194-1.195-3.997-4.007zm-4.808 0a3.605 3.605 0 1 1 0-7.21 3.605 3.605 0 0 1 0 7.21z"></path></svg></span></div></button><span></span><div class="_2cLHw">Cerca o inizia una nuova chat</div><label class="_2MSJr"><input value="" title="Cerca o inizia una nuova chat" dir="auto" data-tab="2" class="jN-F5 copyable-text selectable-text" type="text"></label></div>


Screenshot of more html for page:

<div class="gQzdc">
<button class="C28xL">
<div class="_1M3wR _1BC4w">
<span class="" data-icon="back-blue">
<svg id="Layer_1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24">
<path fill="#4FC3F7" d="M20 11H7.8l5.6-5.6L12 4l-8 8 8 8 1.4-1.4L7.8 13H20v-2z"></path>
</svg>
</span>
</div>
<div class="_1M3wR _3M2St">
<span class="" data-icon="search">
<svg id="Layer_1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24">
<path fill="#263238" fill-opacity=".3" d="M15.009 13.805h-.636l-.22-.219a5.184 5.184 0 0 0 1.256-3.386 5.207 5.207 0 1 0-5.207 5.208 5.183 5.183 0 0 0 3.385-1.255l.221.22v.635l4.004 3.999 1.194-1.195-3.997-4.007zm-4.808 0a3.605 3.605 0 1 1 0-7.21 3.605 3.605 0 0 1 0 7.21z">
</path>
</svg>
</span>
</div>
</button>
<span>
</span>
<div class="_2cLHw">Cerca o inizia una nuova chat</div>
<label class="_2MSJr">
<input value="" title="Cerca o inizia una nuova chat" dir="auto" data-tab="2" class="jN-F5 copyable-text selectable-text" type="text">
</label>
</div>


Up until Friday everything worked great. I also updated the webdriver at 2.42 and chrome was updated to 69. how can I do?

解决方案

As per the HTML you have shared the element is a dynamic element so you have to induce Wait for the element to be clickable and you can use the following solutions:

bot.wait 4000       
bot.FindElementByXPath("//input[contains(@class,'copyable-text selectable-text') and @title='Cerca o inizia una nuova chat']").Click

Note: As an enhancement you need to replae the wait by WebDriverWait

这篇关于硒 whatsapp 按钮搜索 vba的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
其他开发最新文章
热门教程
热门工具
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆