I am currently in the process of making a program to login into selenium and pass the verification. I have the rest of the program thought out and prepared but no matter what I do to click the verify button whether it be by ID or by the text inside, the button won’t click. I ran something into the console to check how many elements had that id and it said only 1.
Here is the line of code that is not working, everything else like the login is working perfectly fine.
WebDriverWait(driver, 30).until(EC.presence_of_element_located((By.ID, "home_children_button"))).click()
EDIT:
After reading the html there seemed to be multiple iframes as pointed out by @ryyyn
but after running something into the console, it only returned one. Now im even more confused than before and am unsure of what to do now.
2
Answers
I have encountered similar situations, and in my opinion, it is likely an
iframe
issue. You can try the following approach:I also recommend debugging the WebDriver elements after attempting to select the element. This can help ensure you’re correctly interacting with the desired elements.
The purpose of this page is to stop you from doing what you’re doing. The "Verify" button is a test to detect whether or not you are using a bot. Since you are using a bot to click the button, it doesn’t allow you to proceed.
Interestingly, you mentioned that it works for you to manually click the button in a browser driven by Selenium. This means that the bot detection is not using a simple approach which can easily be bypassed. ReCAPTCHA works by tracking how your mouse moves before and after you click the button; I would guess that this is doing something similar.
Also, what you’re attempting to do is against LinkedIn TOS, just as a heads up.