close

[Solved] python selenium webscraping “NoSuchElementException” not recognized

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error python selenium webscraping “NoSuchElementException” not recognized in python. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How python selenium webscraping “NoSuchElementException” not recognized Error Occurs?

Today I get the following error python selenium webscraping “NoSuchElementException” not recognized in python.

How To Solve python selenium webscraping “NoSuchElementException” not recognized Error ?

  1. How To Solve python selenium webscraping “NoSuchElementException” not recognized Error ?

    To Solve python selenium webscraping “NoSuchElementException” not recognized Error You sould use from selenium.common.exceptions import * and then write except NoSuchElementException

  2. python selenium webscraping “NoSuchElementException” not recognized

    To Solve python selenium webscraping “NoSuchElementException” not recognized Error You sould use from selenium.common.exceptions import * and then write except NoSuchElementException

Solution 1

You need to import the exception first

from selenium.common.exceptions import NoSuchElementException

and then you can reference it

except NoSuchElementException:
    # handle the element not existing

If you would like to give details of the exception in your output then you can use:

except NoSuchElementException as exc:
    print(exc) # and/or other actions to recover 

Solution 2

You sould use from selenium.common.exceptions import * and then write except NoSuchElementException

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also, Read