小编Ami*_*hal的帖子

如何使用phantomjs等待iframe在selenium python中加载

获取页面的脚本是

 from selenium import webdriver
        from selenium.webdriver.support.ui import WebDriverWait
        from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
        from selenium.webdriver.support import expected_conditions as EC
        import unittest     
        import time, re, castro
        class  LoginTest(unittest.TestCase):

            def setUp(self):
                self.driver = webdriver.PhantomJS()
                self.driver.maximize_window()
                self.driver.get("xxx.html") # getting the page
                "wanna wait her"
                print self.driver.save_screenshot("fire.png")

            def tearDown(self):     
                self.driver.quit()

        if __name__ == '__main__' :
            unittest.main()
Run Code Online (Sandbox Code Playgroud)

HTML 代码iframe

<body>
    <iframe src="http://thunder/spidio.net/CF9F4DA6B7533431/devinfo/devdect   /d,,,_STN&pg=Post=&ckid=null&ord=123&p=mts&cid=0&pid=124" style="background-color: transparent; border : 0px none transparent; padding: 0px; overflow: hidden;" height="1" width"1">
    </iframe>
</body>
Run Code Online (Sandbox Code Playgroud)

请让我知道如何让 selenium 等待这个 iframe 使用 …

python iframe selenium phantomjs selenium-webdriver

4
推荐指数
1
解决办法
4395
查看次数

标签 统计

iframe ×1

phantomjs ×1

python ×1

selenium ×1

selenium-webdriver ×1