找到以下代码:
all_links = driver.find_elements(:xpath,"//fieldset[contains(@class,'attachmentTable')]/table/tbody/tr/td/a")
all_attachment_names = driver.find_elements(:xpath,"//fieldset[contains(@class,'attachmentTable')]/legend")
all_links.each do|link|
href = link.attribute("href").strip
puts href
end
all_attachment_names.each do |name|
text = name.attribute("text")
puts text
end
- 我们可以让这两个循环结合起来运行它们
parallel
吗?前提是两者loop count
相同。 - 我想创建
hash
wherekey will be text
和item will be href
.