我需要的Ruby /硒红宝石/硒值到数组
一些帮助,我有页面上的一些内容是这样的:
<a class="Name" title="Migel" href="/profiles/users/_1324567980000000c/">Migel</a>
我想给HREF字符串值到数组。
当我使用 “find_element” - ALL OK:
profile = driver.find_element(:xpath, "****").attribute ('href')
但页面包含了很多这样的元素,我尝试使用
profile_array = driver.find_elements(:xpath, "lbuh-bluh").attribute ('href')
自然是attribute ('href')
不工作,阵列。 在这种情况下我该怎么办?
,我在执行“随机点击”页面上的任务,我想收集所有的“href”的元素,我需要到数组,然后实现了这样的事情:
array[srtring1, string2....stringN].sample.click
(示意图)
非常感谢。我早些时候使用.map与“find_element”哈哈哈!谢谢 – Dmytro