Python 我正在尝试设计一个作为子元素的Add按钮

Python 我正在尝试设计一个作为子元素的Add按钮,python,css,xpath,selenium-webdriver,webdriver,Python,Css,Xpath,Selenium Webdriver,Webdriver,我在识别我们网站上的“添加”按钮时遇到问题,我正在自动执行该按钮。Python,Webdriver。 我尝试了一些Xpath建议,但它不起作用。我已经和开发人员谈过了,她说按钮在iFrame之外,页面上还有其他添加按钮。我需要找到唯一的一个。我应该使用绝对Xpath,从父级开始,一直到子级 有人知道我可以使用什么Xpath来实现这一点吗?请使用Xpath的祖先或兄弟关键字?谢谢 我试图找到的按钮位于此处: <div class="gwt-HTML" style="margin-left:

我在识别我们网站上的“添加”按钮时遇到问题,我正在自动执行该按钮。Python,Webdriver。 我尝试了一些Xpath建议,但它不起作用。我已经和开发人员谈过了,她说按钮在iFrame之外,页面上还有其他添加按钮。我需要找到唯一的一个。我应该使用绝对Xpath,从父级开始,一直到子级

有人知道我可以使用什么Xpath来实现这一点吗?请使用Xpath的祖先或兄弟关键字?谢谢

我试图找到的按钮位于此处:

<div class="gwt-HTML" style="margin-left: 15px;">Add...</div>
添加。。。
HTML如下所示(为了便于阅读,我缩短了它)

根目录
|   
||运营
||管理
|   
|   
|   |   
|   |   |   
|   |   |   
|   |   |   
|   |   |   
|   |   |   
|   |   |   
|   |   |   
|   |   |   |   
|   |   |   |   
|   |   |   |       
|| | |添加。。。
|   |   |   |   
|   |   |   |   
|   |   |   |   
|   |   |   
|   |   
|   
完整的HTML如下所示:

    <html style="overflow: hidden;">
<head>
<body style="margin: 0px;">
<iframe id="__gwt_historyFrame" style="position: absolute; width: 0; height: 0; border: 0;" tabindex="-1" src="javascript:''"/>
<noscript> <div style="width: 22em; position: absolute; left: 50%; margin-left: -11em; color: red; background-color: white; border: 1px solid red; padding: 4px; font-family: sans-serif;"> Your web browser must have JavaScript enabled in order for this application to display correctly.</div> </noscript>
<script src="spinner.js" type="text/javascript"/>
<script type="text/javascript">   cImageSrc = 'images/sprites.gif';   new imageLoader(cImageSrc, 'startAnimation()');       var info = {      "cc4Address" : "https://riaz-pc.company.local:8889/ClearCore",      "rrdAddress" : "https://riaz-pc.company.local:8889/ClearCoreRRD",      "gazAddress" : "https://riaz-pc.company.local:8889/Gazetteer",         "debugEngine" : "null",         "secure" : "true",         "suppressErrors" : "true",         "testing" : "null",         "serverName" : "riaz-pc.company.local"         };       var timeout = {         "timeoutAlerts" : "300000",         "timeoutDefault" : "5000",         "timeoutLogout" : "3600000",         "timeoutProgress" : "5000",         "timeoutSoap" : "300000",         "timeoutClearDb" : "3600000"         };       var cache = {         "cacheMax" : "500",         "pageSize" : "25",         "startTrig" : "50",         "endTrig" : "450",         "maxUsnSize" :                 "1000",         "defaultPageSize" : "500"         };       var ignoreVersion = {       "major" : "true",         "minor" : "true",         "incremental" : "true"       };   var guiVersion = {              "major" : "5",     "minor" : "1",     "incremental" : "1",     "build" : "5565"     };    </script>
<script src="ClearCore/ClearCore.nocache.js" type="text/javascript"/>
<script defer="defer">ClearCore.onInjectionDone('ClearCore')</script>
<iframe id="ClearCore" src="javascript:''" style="position: absolute; width: 0px; height: 0px; border: medium none;" tabindex="-1"/>
<div style="position: absolute; z-index: -32767; top: -20cm; width: 10cm; height: 10cm; visibility: hidden;" aria-hidden="true"/>
<div style="position: absolute; left: 0px; top: 0px; right: 0px; bottom: 0px;">
<div style="position: absolute; z-index: -32767; top: -20ex; width: 10em; height: 10ex; visibility: hidden;" aria-hidden="true"/>
<div style="position: absolute; overflow: hidden; left: 0px; top: 0px; right: 0px; bottom: 0px;">
<div style="position: absolute; left: 0px; top: 0px; right: 0px; bottom: 0px;">
<div style="position: absolute; z-index: -32767; top: -20ex; width: 10em; height: 10ex; visibility: hidden;" aria-hidden="true"/>
<div style="position: absolute; overflow: hidden; left: 1px; top: 1px; right: 1px; bottom: 1px;">
<div class="gwt-TabLayoutPanel" style="position: absolute; left: 0px; top: 0px; right: 0px; bottom: 0px;">
<div style="position: absolute; z-index: -32767; top: -20ex; width: 10em; height: 10ex; visibility: hidden;" aria-hidden="true"/>
<div style="position: absolute; overflow: hidden; left: 0px; top: 0px; right: 0px; height: 30px;">
<div class="gwt-TabLayoutPanelTabs" style="position: absolute; left: 0px; right: 0px; bottom: 0px; width: 16384px;">
<div class="gwt-TabLayoutPanelTab GAT4PNUK gwt-TabLayoutPanelTab-selected" style="background-color: rgb(254, 255, 238);">
<div class="gwt-TabLayoutPanelTab GAT4PNUK" style="background-color: rgb(254, 255, 238);">
<div class="gwt-TabLayoutPanelTab GAT4PNUK" style="background-color: rgb(254, 255, 238);">
<div class="gwt-TabLayoutPanelTab GAT4PNUK" style="background-color: rgb(254, 255, 238);">
<div class="gwt-TabLayoutPanelTab GAT4PNUK" style="background-color: rgb(254, 255, 238);">
<div class="gwt-TabLayoutPanelTab GAT4PNUK" style="background-color: rgb(254, 255, 238);">
<div class="gwt-TabLayoutPanelTabInner">
<div class="gwt-HTML">Operations</div>
</div>
</div>
<div class="gwt-TabLayoutPanelTab GAT4PNUK" style="background-color: rgb(254, 255, 238);">
<div class="gwt-TabLayoutPanelTabInner">
<div class="gwt-HTML">Administration</div>
</div>
</div>
</div>
</div>
<div style="position: absolute; overflow: hidden; left: 0px; top: 30px; right: 0px; bottom: 0px;">
<div class="gwt-TabLayoutPanelContentContainer" style="position: absolute; left: 0px; top: 0px; right: 0px; bottom: 0px;">
<div style="position: absolute; z-index: -32767; top: -20ex; width: 10em; height: 10ex; visibility: hidden;" aria-hidden="true"/>
<div style="position: absolute; overflow: hidden; left: 0%; top: 0%; width: 100%; height: 100%;">
<div class="gwt-TabLayoutPanelContent" style="position: absolute; left: 0px; top: 0px; right: 0px; bottom: 0px;" aria-hidden="false">
<div style="position: absolute; z-index: -32767; top: -20ex; width: 10em; height: 10ex; visibility: hidden;" aria-hidden="true"/>
<div style="position: absolute; overflow: hidden; left: 0px; top: 0px; right: 0px; height: 35px;">
<div class="GAT4PNUDP GAT4PNUKN" style="position: absolute; left: 0px; top: 0px; right: 0px; bottom: 0px;">
<div class="GAT4PNUGP">
<div class="GAT4PNUCP">
<div>
<select class="gwt-ListBox GAT4PNUEP" style="left: 445px;">
<option value="More tools...">More tools...</option>
<option value="Statistics">Statistics</option>
<option value="Snapshot Trending">Snapshot Trending</option>
<option value="Task Statistics">Task Statistics</option>
<option value="User Alerts">User Alerts</option>
</select>
</div>
</div>
</div>
<div style="position: absolute; overflow: hidden; left: 0px; top: 35px; right: 0px; bottom: 0px;">
<div class="gwt-SplitLayoutPanel" style="position: absolute; left: 0px; top: 0px; right: 0px; bottom: 0px;">
<div style="position: absolute; z-index: -32767; top: -20ex; width: 10em; height: 10ex; visibility: hidden;" aria-hidden="true"/>
<div style="position: absolute; overflow: hidden; left: 0px; top: 0px; bottom: 0px; width: 160px;">
<div style="overflow: auto; position: absolute; background-color: rgb(254, 255, 238); left: 0px; top: 0px; right: 0px; bottom: 0px;">
<div style="position: relative;">
<div>
<select class="gwt-ListBox" style="width: 100%;">
<div class="GAT4PNUDG" __gwtcellbasedwidgetimpldispatchingfocus="true" __gwtcellbasedwidgetimpldispatchingblur="true" role="tree">
<div style="overflow: hidden;">
<div>
<div>
<div aria-selected="false" role="treeitem" aria-setsize="1" aria-posinset="1" aria-expanded="true" aria-level="1">
<div class="GAT4PNUIF GAT4PNUAG" style="padding-left: 0px;">
<div style="overflow: hidden;">
<div>
<div>
<div aria-selected="false" role="treeitem" aria-setsize="3" aria-posinset="1" aria-expanded="false" aria-level="2">
<div aria-selected="false" role="treeitem" aria-setsize="3" aria-posinset="2" aria-expanded="false" aria-level="2">
<div aria-selected="false" role="treeitem" aria-setsize="3" aria-posinset="3" aria-expanded="false" aria-level="2">
<div class="GAT4PNUIF" style="padding-left: 16px;">
<div class="GAT4PNUIF GAT4PNUKF" style="padding-left: 16px;position:relative;" onclick="">
<div class="GAT4PNUJF" style="left: 0px;width: 15px;height: 15px;position:absolute;">
<div class="GAT4PNULF">
<div style="padding-left: 22px;position:relative;zoom:1;">
<div style="left:0px;margin-top:-8px;position:absolute;top:50%;line-height:0px;">
<div>
<span class="" title="Tasks" style="white-space:nowrap;overflow:hidden;text-overflow:ellipsis;empty-cells:show;display:block;">Tasks</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="GAT4PNUHF" style="display: none;">Empty</div>
<a class="GAT4PNUPF" href="javascript:;" style="display: none;">Show more</a>
</div>
</div>
</div>
</div>
<div class="GAT4PNUHF" style="display: none;" tabindex="0">Empty</div>
<a class="GAT4PNUPF" href="javascript:;" style="display: none;">Show more</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div style="position: absolute; overflow: hidden; left: 160px; top: 0px; bottom: 0px; width: 8px;">
<div class="gwt-SplitLayoutPanel-HDragger" style="width: 8px; position: absolute; left: 0px; top: 0px; right: 0px; bottom: 0px;"/>
</div>
<div style="position: absolute; overflow: hidden; left: 168px; top: 0px; right: 0px; bottom: 0px;">
<div style="position: absolute; left: 0px; top: 0px; right: 0px; bottom: 0px;">
<div style="position: absolute; z-index: -32767; top: -20ex; width: 10em; height: 10ex; visibility: hidden;" aria-hidden="true"/>
<div style="position: absolute; overflow: hidden; left: 0px; top: 0px; right: 0px; bottom: 0px;">
<div style="position: absolute; left: 0px; top: 0px; right: 0px; bottom: 0px;">
<div style="position: absolute; z-index: -32767; top: -20ex; width: 10em; height: 10ex; visibility: hidden;" aria-hidden="true"/>
<div style="position: absolute; overflow: hidden; left: 0px; top: 0px; right: 0px; height: 24px;">
<div class="workspacetoolbar" style="position: absolute; left: 0px; top: 0px; right: 0px; bottom: 0px;">
<div>
<div style="position: absolute; top: 3px; left: 5px;">
<span class="gwt-InlineLabel" style="font-weight: bold; color: black; margin-right: 5px; margin-left: 20px;">Reports</span>
<div class="GAT4PNUMP">
<button class="gwt-Button" type="button">
<div style="position: absolute; margin-left: 2px;">
<img border="0" style="width:14px;height:14px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAACyklEQVR42l2SeUjTUQDHn62mbmr+kXk08WCpbJmY4p1ppY5Mu4hAE8XQmRVpTbyyPxIzyeaB06ZtHh2baxvqbAZjlorzSE2lQ5MOg1Iw/CPRMPD37adkRd/Hhy883of3eO8RqVS6rarqbnWjXKGSVDf11koejUlqlO9rqjULVZXalYL8BlNiQlHx0ZhLAYQQJtmMTqdjGQwmzM8Dc3PA7OwqpqaWMTGxBJNpEZ2dH1FfP4i8PCUEAmEmrVhviFKpjqXX92I9MzPfqdGhz5TRMAy12oim5g5IalRUpViJa/ky+O6NVNKKN40ZUYlNlo3aUeinVrH49SdkpiZ0Dz6njDojOh60oaVOg/JyDa7kNsPLK6yLlgI3RPZFm8vidgUejy3BOA5EtSbAvykYdfpRRBePw71wBC43RhCUo4crL2JdDKLZQhhJjDhOmQMCFP7gy/3g+dAd5z9Eg1O/B1rDIKrvqJFbrEZqdgs8PEP/ir6nfe3iZScR3OOGtNlDyF84gXtrQpQuJ8Khlo8L6iWQvGnwsg1w9gzX/xFVqmdWiq4e+MtiwG10Ak/JQdG3U9glc0ab4SlKb93E1gZC2UutsT3Q9pM5YQs2RJGohS2p0KFvbAV13dPUPnkEHOu4KG7rg0tJJ0hRA44PcHHGEALiR94QH3KW7m0kJaXRoiiv5a1GOQlN+xcktxZQZQotrl7vgqWUIL7fHRmvIqi0yVDqoJELVi4TxIl4rj+lWWR4yhFRtvydVDIAuaQfhaL7yBLKYFdji4Te/Uh9GUIJX4RRcWo+rM4x1wibHN78QJYBfscS0tMrZpKTbv+Ijc2ajjyQPLQj3HU4LCNqOeiJE2JVPBAv8ppGTMzJbvJPbDgcvsDOzq2EzbYVM5kWheaElWnv4yC3yGHAKpVJEQ9aIsRx43L+C4vGmYb7u3fSx7KnhzfdUfROHvQcY33hL6HaY35wVehRAAAAAElFTkSuQmCC) no-repeat 0px 0px;" src="http://justin-pc.infoshare.local:8080/clearcore501/ClearCore/clear.cache.gif" onload="this.__gwtLastUnhandledEvent="load";"/>
</div>
<div class="gwt-HTML" style="margin-left: 15px;">Add...</div>
</button>
<button class="gwt-Button" type="button" disabled="">
<button class="gwt-Button" type="button" disabled="">
<div class="GAT4PNUMP">
<button class="gwt-Button" type="button" title="Run the selected reports" disabled="">
<button class="gwt-Button" type="button" title="View the selected report" disabled="">
<button class="gwt-Button workspacebuttontext130" type="button" title="Conditional report" disabled="">Conditional report ▼</button>
<div class="GAT4PNUMP">
<select class="gwt-ListBox" style="height: 20px; margin-right: 5px;" disabled="">
</div>
<img class="gwt-Image helplink pointer" border="0" style="width:16px;height:16px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAADAElEQVR42m1TW0iTYRieE7tUB17ajRBFeBOUYaBoTtG8ULQMxKR0HgjBoVJh4CEtPPw6IUHKQ2o1nCPNAwax2WZzrjyl8zCn/puHf3PN4zZSEnv6tv6WlQ88Nx/f877f877Px+Ecw+LiordSqSxQq9XKifFxRjMywnR3dw3V19cXRkVFnSZXThF6cE4CwzD8ublZ88E3Bxy2XRhMVhgYK2w7W7CYGUgkEnNOTk4yuepDyP1PbKBporWj5YMRD97ZIexzIEO6i+R2C2r6l7Bl3YC0s/MgLi4ui0j83EXGxsZ8ZrRas8NuAyXbhEj9A5TqEKWyfeT37iFDso34ZgvutBpgMa2jhqJMPB4vln2JB0culxc4bHt4oVhBjeoIAwvfsbZziN+wHxyha3IX4U9XUdGjh3ZqAqGhoQ1EHEjoxVEoFMrtTSvuD9jxRG6D0boP3foOUit7kVDyxl0osm4BISIjVmk9UlJSNEScQMjjDKtUjH7F5PJc2GPF3QY10urkyG6ZxtzaHkYXzMhtUCCsSovAChpTszoIhbkMEecR+nNkMhmjN5ggkO4hr2cbQimDnNdGd+fwex0IKx1ESLUO58ppTEzNIjs701ngEWEARywWDzmHk/zqKwQdm8js3MLtthVcK+l3iSMrRhEhWsLlqmUEUUbQizpER0d/chegKKqQXtajum8B8S0W3GzdQOKzPy+IqNXjSg2Ns2VLKJHOQERVIiAgQOy2EBMT49/U2GheNS4j7eUKrtavg187j6D8t7gg7MbFsmmX+MZzA1RKGZKSkkyenp7N7iE6V5Genp7c3NR0oNfNorxrHqEiA84XfcGZh5O4VE2jWKLF0OB7ZAgE+yQDbURT5F4jm20f4iurpKjIJG5vxdS4BiOfJzCsGYX64yAelxa7Ovv6+jrFVYSR7iCxcMbSz9vbOzY4OLjhemKiRiAQrKWm3lrj8/kap2cul9vEdo78K8rHwGWrBrL+nEMqZZnHngWe+JmOwYP1xXNN2LmmX/Rnz7z+/c4/ARDk76ne92ZwAAAAAElFTkSuQmCC) no-repeat 0px 0px;" src="http://justin-pc.infoshare.local:8080/clearcore501/ClearCore/clear.cache.gif" onload="this.__gwtLastUnhandledEvent="load";"/>
</div>
</div>
<div style="position: absolute; overflow: hidden; left: 0px; top: 24px; right: 0px; height: 24px;">
<div style="position: absolute; overflow: hidden; left: 0px; top: 48px; right: 0px; bottom: 0px;">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div style="position: absolute; overflow: hidden; display: none; left: 0px; top: 0px; right: 0px; bottom: 0px;">
<div style="position: absolute; overflow: hidden; display: none; left: 0px; top: 0px; right: 0px; bottom: 0px;">
<div style="position: absolute; overflow: hidden; display: none; left: 0px; top: 0px; right: 0px; bottom: 0px;">
<div style="position: absolute; overflow: hidden; display: none; left: 0px; top: 0px; right: 0px; bottom: 0px;">
<div style="position: absolute; overflow: hidden; display: none; left: 0px; top: 0px; right: 0px; bottom: 0px;">
<div style="position: absolute; overflow: hidden; display: none; left: 0px; top: 0px; right: 0px; bottom: 0px;">
</div>
</div>
</div>
</div>
<div style="position: absolute; overflow: hidden; top: 1px; right: 1px; width: 30px; height: 25px;">
<div style="position: absolute; overflow: hidden; left: 0px; top: -25px; right: 0px; height: 25px;">
</div>
</div>
</div>
<div style="display: none;" aria-hidden="true"/>
</body>
</html>

您的web浏览器必须启用JavaScript才能正确显示此应用程序。
cImageSrc='images/sprites.gif';新的图像加载器(cImageSrc,'startAnimation()');变量信息={“cc4Address”:https://riaz-pc.company.local:8889/ClearCore,“rrdAddress”:https://riaz-pc.company.local:8889/ClearCoreRRD,“地址”:https://riaz-pc.company.local:8889/Gazetteer,“debugEngine”:“null”,“secure”:“true”,“suppressErrors”:“true”,“testing”:“null”,“serverName”:“riaz-pc.company.local”};var timeout={“timeoutAlerts”:“300000”,“timeoutDefault”:“5000”,“timeoutLogout”:“3600000”,“timeoutProgress”:“5000”,“timeoutSoap”:“300000”,“timeoutClearDb”:“3600000”};var cache={“cacheMax”:“500”,“pageSize”:“25”,“startTrig”:“50”,“endTrig”:“450”,“maxUsnSize”:“1000”,“defaultPageSize”:“500”};var ignoreVersion={“主”:“真”、“次”:“真”、“增量”:“真”};var guiVersion={“主要”:“5”,“次要”:“1”,“增量”:“1”,“构建”:“5565”};
onInjectionDone('ClearCore')
操作
管理
更多工具。。。
统计
快照趋势分析
任务统计
用户警报
任务
空的
空的
报告
添加
有条件报告▼
是否尝试以下操作

//button[@class='gwt-Button']/div[text()='Add...']
或者只是

//div[text()='Add...']
谢谢

试试下面的方法

//button[@class='gwt-Button']/div[text()='Add...']
或者只是

//div[text()='Add...']
谢谢

试试下面的方法

//button[@class='gwt-Button']/div[text()='Add...']
或者只是

//div[text()='Add...']
谢谢

试试下面的方法

//button[@class='gwt-Button']/div[text()='Add...']
或者只是

//div[text()='Add...']

谢谢

我已经找到了Add按钮,并使用下面的Xpath单击它

driver.find_element_by_xpath("/html/body/div[2]/div[2]/div/div[2]/div/div[3]/div/div[8]/div/div[3]/div/div[4]/div/div[2]/div/div[2]/div/div/button[1]")
我理解这不是最好的方法,因为如果结构发生变化,Xpath就会崩溃。我将暂时使用它,直到找到更好的方法。
如果有人能提供更好的Xpath,我已经更新了问题中的HTML

父类是class='gwt-TabLayoutPanelTabs' 下一个父类是Administration 这是按钮所在的位置,它位于Administration类中

如果我使用下面的Xpath,我可以访问Administration类,但是我不知道如何访问按钮

//div[@class='gwt-TabLayoutPanelTabs']/div[7]

谢谢。

我已经找到了添加按钮,现在使用下面的Xpath单击它

driver.find_element_by_xpath("/html/body/div[2]/div[2]/div/div[2]/div/div[3]/div/div[8]/div/div[3]/div/div[4]/div/div[2]/div/div[2]/div/div/button[1]")
我理解这不是最好的方法,因为如果结构发生变化,Xpath就会崩溃。我将暂时使用它,直到找到更好的方法。
如果有人能提供更好的Xpath,我已经更新了问题中的HTML

父类是class='gwt-TabLayoutPanelTabs' 下一个父类是Administration 这是按钮所在的位置,它位于Administration类中

如果我使用下面的Xpath,我可以访问Administration类,但是我不知道如何访问按钮

//div[@class='gwt-TabLayoutPanelTabs']/div[7]

谢谢。

我已经找到了添加按钮,现在使用下面的Xpath单击它

driver.find_element_by_xpath("/html/body/div[2]/div[2]/div/div[2]/div/div[3]/div/div[8]/div/div[3]/div/div[4]/div/div[2]/div/div[2]/div/div/button[1]")
我理解这不是最好的方法,因为如果结构发生变化,Xpath就会崩溃。我将暂时使用它,直到找到更好的方法。
如果有人能提供更好的Xpath,我已经更新了问题中的HTML

父类是class='gwt-TabLayoutPanelTabs' 下一个父类是Administration 这是按钮所在的位置,它位于Administration类中

如果我使用下面的Xpath,我可以访问Administration类,但是我不知道如何访问按钮

//div[@class='gwt-TabLayoutPanelTabs']/div[7]

谢谢。

我已经找到了添加按钮,现在使用下面的Xpath单击它

driver.find_element_by_xpath("/html/body/div[2]/div[2]/div/div[2]/div/div[3]/div/div[8]/div/div[3]/div/div[4]/div/div[2]/div/div[2]/div/div/button[1]")
我理解这不是最好的方法,因为如果结构发生变化,Xpath就会崩溃。我将暂时使用它,直到找到更好的方法。
如果有人能提供更好的Xpath,我已经更新了问题中的HTML

父类是class='gwt-TabLayoutPanelTabs' 下一个父类是Administration 这是按钮所在的位置,它位于Administration类中

如果我使用下面的Xpath,我可以访问Administration类,但是我不知道如何访问按钮

//div[@class='gwt-TabLayoutPanelTabs']/div[7]

谢谢。

(1)清理HTML;这是一个畸形的混乱。(2) 使用
switchTo()
切换到正确的
iframe
,然后再尝试查找按钮;看,我粘贴了Firefox的HTML,开发工具。这就是html的用法。开发人员构建了它。或者我应该展开每个标记并将其粘贴进去?开发者说按钮在iFrame之外。我不需要切换到它。我已经试着切换到它,看看它是否能找到按钮。它找不到按钮。谢谢你的建议。然后要么你粘贴得不好,要么开发人员构建得不好(或者两者兼而有之)。我们不能向你方提供咨询