Skip to content
Advertisement

Selenium can not find element from workera.ai

I am trying to scrape question answers from workera.ai but I am stuck because Selenium cannot find any element I searched for using class. When I check the page source the element is available but Selenium can not find it. Here is what I am doing.

Signup using: https://workera.ai/candidates/signup

JavaScript

I don’t know why it is happening. Does the site block Selenium web drivers or it is something else?

Edit

I tried getting page source from Selenium and then accessing elements using bs4 and it is working. So I think the website is blocking Selenium by some mean.

Advertisement

Answer

The problem with selenium is that you can’t select elements that has more than one class like this.

In order to select them, you can either mention one class in the value, or use “.” for example:

JavaScript

Also you can select the class that exists for all the answers which I believe it is this one “sc-jNHgKk”, so you won’t have the problem to select a class for each account, or you can just use XPATH instead.

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement