【发布时间】:2021-12-15 03:08:15
【问题描述】:
我想下载视频,但是有问题
我正在尝试关闭弹出窗口
我使用的代码无效
这是我的代码
Sub Close_Pop_up()
With New ChromeDriver
.Get "https://snaptik.app/en/"
.FindElementById("url").SendKeys ("https://www.tiktok.com/@funny_v.i.p/video/7020796826760547590")
.FindElementById("submiturl").Click
.FindElementByXPath("/html/body/main/section[2]/div/div/article/div[2]/div/a[1]/span/span").Click
.SwitchToFrame .FindElementByTag("iframe", TimeOut:=10000)
.FindElementById("dismiss-button").Click
End With
End Sub
这是html代码
<div class="ns-dws4v-e-6 close-button" id="dismiss-button" x-ns-dws4v-e="6" x-overflow-forbidden="xy" aria-label="Close ad" tabindex="1"><div class="ns-dws4v-e-7 close-text" x-ns-dws4v-e="7"><span class="ns-dws4v-e-8" dir="auto" x-ns-dws4v-e="8" x-score="1">Close</span></div></div>
谁能给出一个好主意?
【问题讨论】:
-
has not worked意味着什么?你收到错误信息了吗?什么都没发生吗? ...... -
找不到 id=dismiss-button 的元素
-
您确定要切换吗?