Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
可変テキストのリンクをクリックしたい:
@variabletext = 'text' +@timestamp
しかし、リンクには01 # text010120121134のような番号があります。私はテキスト010120121134を知っています。誰かが既知のテキストのみのリンクをクリックするのを手伝ってくれますか?
リンクのテキストの一部しか知らない場合は、正規表現を使用してテキストを照合します。
browser.link(:text => /text010120121134/).click
これは次のリンクと一致します。
<a>01 # text010120121134</a>
テキスト「01 # text010120121134」は正規表現パターン「/text010120121134/」に一致するためです。正規表現は「/」で示されることに注意してください。