DEV Community

Discussion on: Automated Dapps Scrapping with Selenium and Metamask

Collapse
 
fedeblengio profile image
Federico Blengio

Thanks bro, it has helped me a lot, but I have a problem for days I am trying to solve it but I can not.

any ideas?

Collapse
 
fedeblengio profile image
Federico Blengio

here is my problem
prnt.sc/1oab8yn

Collapse
 
baotran810 profile image
baotran810 • Edited

Hi Federico,
I also got the issue "NoSuchElementException" because it couldn't locate the "Get started" button. While debugging, I found that it focused on the first page when I ran the script, so I switched to the first tab to close then it only focused on the MetaMask page then the "Get started" button was able to locate. Here is the script I used, I hope it would help you.

await driver.getAllWindowHandles().then(function (handles) {
driver.switchTo().window(handles[1]);
driver.close()
driver.switchTo().window(handles[0]);
});

Thread Thread
 
fedeblengio profile image
Federico Blengio

Thank you

Thread Thread
 
fedeblengio profile image
Federico Blengio

I have a question to ask about handles, you can send a dm?

Thread Thread
 
escaraptor09 profile image
Marc Ferri

How did you finally solved it?????

Collapse
 
escaraptor09 profile image
Marc Ferri

I got the same problem

Collapse
 
ltmenezes profile image
Leonardo Teixeira Menezes

Hey Federico, good to know that this article is helping you, thanks for the feedback!
This kinds of issues might happen because the behaviour of the extension might differ depending on the metamask extension version.
In these cases the best approach is to use some python debugger (such as IPDB) to stop the code for you to find exactly what is different in your version, most times you only need to do some minor changes.
Just followed you, feel free to drop a DM if you still have the issue!