python selenium ΪʲôһֱÕÒ²»µ½ÍøÒ³µÄµÄ°´Å¥ÔªËØ
ÓÃpython×öÒ»¸ö×Ô¶¯µÇ½µÄ½Å±¾£¬ÈçÏÂΪÍøÒ³µÄµÇ½°´Å¥µÄ´úÂ룬ĬÈÏÊDz»¿Éµã»÷µÄ£¬Èç¹ûÊäÈëÓû§Ãû¼°ÃÜÂë²Å¿Éµã»÷¿ÉÊÇÿ´ÎÓà find_element_by_class_name ÕÒµ½Õâ¸ö°´Å¥¾Í±¨´í£¬¸ü±ð˵×Ô¶¯µã»÷ÁË
ÇëÎʸÃÈçºÎ½â¾ö
ÓÐÕâôһ¸ö×Ö¶Îtext = hold£¬Õâ¸öÊÇÇ°¶ÎÅжÏuser¡¢pwdÊÇ·ñÌîдµÄÒ»¸ö×ֶΣ¬ËùÒÔÕâ¸öclass-name²»ÊÇΨһ£¬ÊǶ¯Ì¬µÄ£¬½¨ÒéÓÃÆäËû¶¨Î»·½Ê½£¬Èç
default_driver.find_element_by_xpath("//button").click() Â¥ÉϵÄxpath¶¨Î»¾ÍºÜºÃ ¶¨Î»µÄÔªËغÍÆäËûµÄnameµÄÓгåÍ»£¬»»¸öclassµÄ¶¨Î»ÔªËØÊÔÏ£¬´øÉÏ.cklieµÄÊäÈëµÄ£¬ÎÒÍü¼ÇÊDz»ÊÇÕâ¸öµ¥´ÊÁËÐèÒªËÑË÷Ï£¬Ö±½Ó¾Í¿ÉÒÔÊäÈ룬ÊäÈëÍêÔÚ¶¨Î»µÇ¼µÄÔªËØÈ»ºóµã»÷²Ù×÷ ²»ÒªÓÃcss¶¨Î» class name¿ÉÄܲ»Î¨Ò»°É£¬»»¸öxpath¶¨Î»ÊÔÊÔÄØ¡£ ÕÒΨһ
Ò³:
[1]