如何使用特定的班级名称单击每个DIV

发布于 2025-02-06 21:46:30 字数 101 浏览 2 评论 0原文

我是一个新手程序员,所以请我。 我必须从主窗口打开一堆弹出窗口,以刮擦一些数据。 但是,没有一个链接只有很多带有相同类名的divs,当单击打开弹出窗口时。 我该如何使用Watir? 谢谢。

I'm quite a newbie programmer so pardon me.
I have to open a bunch of popup windows from the main one, to scrape some data.
But there's not a link just many divs with the same class name, that when clicked open the popups.
How do I do that using watir?
Thank you.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

套路撩心 2025-02-13 21:46:30

您可以使用以下匹配的类名来获得所有DIVS:

divs = browser.divs(class: 'whatever_your_class_is')

可以像其他任何元素类型一样单击它们 - 例如:

divs.each do |div|
  div.click
end

You can get all the divs with the matching class name using:

divs = browser.divs(class: 'whatever_your_class_is')

They can be clicked like any other element type - eg:

divs.each do |div|
  div.click
end
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文