![]() ![]() If your computer or network is protected by a firewall or proxy, make sure If you are unable to load any pages, check your computer's network stop () except Exception, e : print ": %s " % str ( e ) if _name_ = '_main_' : try : b, d = function () close ( b, d ) except Exception, e : print eĬheck the address for typing errors such as quit () except Exception, e : print ": %s " % str ( e ) try : display. find_element ( by = how, value = what ) except NoSuchElementException as e : return False return True def close ( browser, display ): try : browser. sleep ( 10 ) except Exception, e : print e return browser, display def is_element_present ( driver, how, what ): try : driver. page_source ) try : print is_element_present ( browser, By. From selenium import webdriver from import Keys from import By from import NoSuchElementException from pyvirtualdisplay import Display def function (): display = Display ( visible = 0, size = ( 800, 600 )) display. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |