selenium iframe切换
使用selenium定位时,经常会出现元素定位不到的提示,有时是因为元素在内嵌iframe中,所以需要先切换。iframe元素切换主要有以下几种方式:
一、切换到子frame
switch to.frame("framenameortittle");
二、切换到父frame
switch to.parent_frame()
三、切换到默认frame
switch to.default_frame()