0

We all know how to get Selector via "hand".

  1. Hover the cursor over the image and right click mouse.
  2. Select Inspect.
  3. See the highlighted image code.
  4. Right click on the highlighted code.
  5. Select Copy > Copy selector.

But how do it via code?

The above 5 steps in an animated gif: https://i.stack.imgur.com/KEXyF.gif

I use C#, selenium library. I have a list of elements. And I want to iterate over it and copy the Selector of each individual element. My programming skills are terrible, so I would appreciate any comments even if it's technically impossible. My wanderings on chrome, and the torture of the gpt chat did not give me anything

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Deni
  • 1
  • Stepping back, if you have the list of elements, why do you need a selector? You can just go through the array elements that you already have. – Tim Roberts May 14 '23 at 17:31
  • Is this a duplicate of: [Finding CSS selector path for Selenium C#](https://stackoverflow.com/questions/47383732/finding-css-selector-path-for-selenium-c-sharp) ? – Luuk May 14 '23 at 17:47

0 Answers0