method is looking forthe selenium module raises nosuchelement exception if you do not want this exception to crash your programadd try and except statements to your code once you have the webelement objectyou can find out more about it by reading the attributes or calling the methods in table - table - webelement attributes and methods attribute or method description tag_name the tag namesuch as 'afor an element get_attribute(namethe value for the element' name attribute text the text within the elementsuch as 'helloin hello clear(for text field or text area elementsclears the text typed into it is_displayed(returns true if the element is visibleotherwise returns false is_enabled(for input elementsreturns true if the element is enabledotherwise returns false is_selected(for checkbox or radio button elementsreturns true if the element is selectedotherwise returns false location dictionary with keys 'xand 'yfor the position of the element in the page for exampleopen new file editor tab and enter the following programfrom selenium import webdriver browser webdriver firefox(browser get('tryelem browser find_element_by_class_name(cover-thumb'print('found element with that class name!(elem tag_name)exceptprint('was not able to find an element with that name 'here we open firefox and direct it to url on this pagewe try to find elements with the class name 'bookcover'and if such an element is foundwe print its tag name using the tag_name attribute if no such element was foundwe print different message this program will output the followingfound element with that class namewe found an element with the class name 'bookcoverand the tag name 'img