CyberKeeda In Social Media

Selenium XPATH Cheat Sheet


XPATH that contains Partial Text.

Example to Consider.

<span class="style-scope ytd-grid-video-renderer">1 day ago</span>

<span class="style-scope ytd-grid-video-renderer">84K views</span>

<span class="style-scope ytd-grid-video-renderer">1 hour ago</span>

<span class="style-scope ytd-grid-video-renderer">8 hour ago</span>

Need to Grep elements with Text that contains partial word as hour

Code Snippet.

 //*[contains(text(), "hour")]

In case if to Grep elements that contains partial tag.

 //*[contains(@id, "title")]

No comments:

Post a Comment

Designed By Jackuna