-5

enter image description here

How do I find locator for a search box from this HTML code? I tried all the possible ways but no luck.

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
  • 1
    Can you share some code where you are unable to proceed? – anurag Jan 06 '21 at 10:26
  • 1
    Please do not post the HTML as image post it as formatted text so community members will be able to copy it possibly into an xpath tester tool or other. – Bence Kaulics Jan 06 '21 at 10:51

2 Answers2

0

There are a bunch of options:

XPath = "//input[@placeholder='Enter a question']"
CSS = "[type='search']"
ID = "rc_select_1"
Villa_7
  • 508
  • 4
  • 14
0

To locate the element you can use either of the following Locator Strategies:

  • Using css_selector:

    input.ant-input.ant-input-lg[placeholder='Enter aquestion']
    
  • Using xpath:

    //input[@class='ant-input ant-input-lg' and @placeholder='Enter aquestion']
    
undetected Selenium
  • 183,867
  • 41
  • 278
  • 352