You can use the css nth-of-type
pseudo class to get elements based on their index (or relative position).
For example, a:nth-of-type(1)
can be used to return all links that are the first line of their parent:
links(:followees_category, :css => "p.schedule-text a:nth-of-type(1)")
For the second links, you can do a:nth-of-type(2)
. Note that it is 1-based index.
links(:followees_category, :css => "p.schedule-text a:nth-of-type(2)")
For the first link, you can also do a:first-of-type
:
links(:followees_category, :css => "p.schedule-text a:first-of-type")
If the second link is always the last link, you can also do a:last-of-type
:
links(:followees_category, :css => "p.schedule-text a:last-of-type")