先找到文本編輯區所在的iframe標籤。
切換至iframe標籤:
方法1:iframe有id 或 name
driver.switch_to_frame("iframename/id")
方法2:iframe無id/name情況
frame=driver.find_element_by_xpath(" ")
#切換至iframe
driver.switch_to_frame(frame)
找到接收文本的對像,進行sendkeys()
這樣就能開始查找iframe內的對像了。
如果需要找iframe之外的對像,要切換出iframe
driver.switch_to_default_content()