【发布时间】:2018-09-15 02:54:37
【问题描述】:
我正在收集 Twitter 的关注按钮。如何将按钮限制为仅 30 个按钮而不是页面上的所有按钮?
#Collect the "Follow" buttons
browser.spans(:class => ['user-actions-follow-button js-follow-btn follow-button']).each do |b|
#Click them! One by one.
b.click
# Generate random sleep period
r = Random.rand(4...7)
#Sleep so not to appear like a bot.
sleep(r)
# end
end
【问题讨论】:
标签: ruby selenium-webdriver twitter watir