- ©«¤l
- 354
- ¥DÃD
- 5
- ºëµØ
- 0
- ¿n¤À
- 387
- ÂI¦W
- 0
- §@·~¨t²Î
- windows7
- ³nÅ骩¥»
- vba,vb,excel2007
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2017-1-8
- ³Ì«áµn¿ý
- 2024-8-2
|
¥»©«³Ì«á¥Ñ singo1232001 ©ó 2022-10-15 03:16 ½s¿è
¦^´_ 18# t8899
1
§PÂ_ºô¶ ¥i¥H¥Îif §PÂ_¦¡
¸ÕµÛ¥Î¸Ì±ªº ª«¥ó¦s¦bª¬ºA or ª«¥ó¼Æ¶q or ª«¥ó¦WºÙ or ª«¥ó¤å¦r or ºô¶Title¦WºÙ(¥i¯à«½Æn¬ÝÓ®×) ¨Ó§PÂ_¸õ¹L
¥i¥H¥ý¤Uon error resume next ©¿²¤¿ù»~
¥H¤U¥i¨Ñ¬D¿ï§PÂ_¤è¦¡
±Ò¥Î¥i¥H¥Îisobject() =true
¼Æ¶q¥Î.count>0
¦WºÙ¥Î.attribute
¤å¦r¥Î.text
ºô¶title¦WºÙ ¥Î.title
¤Wz¤å¦r¥i¥H·f°tvbaªºinstr like find ³o¦C¤å¦r·j¯Áªº¥\¯à°µ§PÂ_
2
xpath§Ú¤£¤Ó±`¥Î ©Ò¥H½mªº¤£¼ô §Ú²ßºD¥Îtag§ì¦ì¸m ³q±`«Ü°ªªº°ª¤â·|¥Îxpath ©ÎªÌ¹B®ð¤£¿ùè¦n¯à¥Î(¸Ó¤¸¯À¨S¦³«áÄò¤~ºCºC¥X²{)
¥Dnì¦]¬O ¦³®ÉÔ ºô¶¤£·|¤@¦¸©Ê¸õ¥X¨Ó ¥L·|ºCºC¸õ ·íµM¤]¥i¥H¥Îwait¨Óµ¥
¤]´N¬O¤§«e»¡¨ìªºª¬ªp ¥Îtag³v¨B§äªº¤è¦¡,³oºØ¤À¸Ñ¨BÆJ¥i¥HºCºC§PÂ_¬O§_¤¸¯À¦³¥X²{¤F ¦AÄ~Äò¤U¤@¨Bªº§PÂ_
3
¦L¶H¥i¥H ¦ý¤£«Øij ©È¦hÓµøµ¡title«½Æ ¬ÝӮרϥÎ
¤U±¬O§Ú¬d¨ìªº¸ê®Æ
»yªk¦n¹³¬O driver.SwitchToWindowByTitle "Title¦WºÙ" ¤£¹L§Ú¨S¹ê´ú¹L
https://stackoverflow.com/questions/52397268/how-do-i-switch-focus-to-a-new-window-using-selenium-vba
(¥i¥H¤UgoogleÃöÁä¦r vba selenium SwitchToNextWindow )§ä¬ÛÃö¸ê®Æ
³q±`§ÚÁÙ¬O«Øij¥Îdriver.SwitchToNextWindow¸õÂà
¸õ¹L¥h¦pªG¤£n¤F,¤]ÁÙ¬OnÁÙn¥Îdriver.SwitchToPreviousWindow¸õ¦^¨Ó |
|