1

How do I extract the following "label" using the chrome driver in Selenium for VBA? The information that I want is "Character 3"

HTML:

<label for="frmentermemorableinformation1:strEnterMemorableInformation_memInfo1">Character 3 &nbsp;</label>

1 Answer 1

2

To print the text Character 3 you can use either of the following locator strategies:

  • Using css_selector:

    Debug.Print .FindElementByCss("label[for^='frmentermemorableinformation1'][for$='strEnterMemorableInformation_memInfo1']").Text
    
  • Using xpath:

    Debug.Print .FindElementByXPath("//label[starts-with(@for, 'frmentermemorableinformation1') and contains(@for, 'strEnterMemorableInformation_memInfo1')]").Text
    
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.