主要记录自己在自学python+selenium时解决的问题。
遇到问题代码。(局部)
page = driver.page_source
使用该方法不能获取到网页源码,上报“can’t access dead object”错误
原因:在该代码之前使用driver.switch_to.frame(“x-URS-iframe”),跳入了一个frame
总结:在使用了switch_to.frame()跳入frame后,需要使用switch_to.default_content()跳出frame