0

I'm using selenium and can't find this class

var element = driver.FindElement(By.XPath("//*[contains(@class, 'rc-imageselect-table-33')]")).Text; //works

from this link https://patrickhlauke.github.io/recaptcha/

and the html has the class http://prntscr.com/d3co2r

Can anybody help me ?

0

Try with

driver.findElement(By.CssLocator("img.rc-image-tile-33")).Text

and if this doesn't work try to put a parent container in front of the locator. Example

"#tableID img.rc-image-tile-33"

Probably somewhere on the page there is another img with the same class name.

| improve this answer | |
0

Can you try please try this:

var element = driver.FindElement(By.ClassName("rc-imageselect-table-33");

Because most of the times finding an element through xpath can be a difficult.

| improve this answer | |
  • not works ( can u try it ! – xz01345 Nov 5 '16 at 13:14
  • Can you be specific about what do you want to do with that image, do you want to click, the specific images in the capatcha? – the_coder Nov 5 '16 at 13:17
  • i want catch element to can download it and click it ,i hope u can help – xz01345 Nov 5 '16 at 13:19
  • I came to know that my solution was failing because all the respective individual images have the same class name. – the_coder Nov 5 '16 at 13:32
  • as you see prntscr.com/d3e38l it's only 1 class and i want catch it to can take screenshopt then click to box ! – xz01345 Nov 5 '16 at 13:40
0

Have you tried to check it if these image are inside an iframe node? If it is the case, you should switch first to the iframe. You should share more piece of your HTML. Then. I will be able to help more appropriately.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.