python代码运行不了怎么办_selenium ide 生成的 Python 代码无法执行是怎么回事?
用的是 firefox 的 selenium ide
我隨便測試一個代碼就是點開了一個連接然后生成下面的代碼但是無法運行,
提示ImportError: cannot import name 'selenium' 感覺是很老的代碼了, 這個代碼應該怎么處理才能正常的使用?
# -*- coding: utf-8 -*-
# from selenium import selenium
import selenium
import unittest, time, re
class test(unittest.TestCase):
def setUp(self):
self.verificationErrors = []
self.selenium = selenium("localhost", 4444, "*chrome", "https://github.com/")
self.selenium.start()
def test_test(self):
sel = self.selenium
sel.open("/SeleniumHQ/selenium/wiki/SeIDEReleaseNotes")
sel.click("link=exact:http://blog.reallysimplethoughts.com/2015/03/09/selenium-ide-scheduler-has-arrived-part-1/")
sel.wait_for_page_to_load("30000")
def tearDown(self):
self.selenium.stop()
self.assertEqual([], self.verificationErrors)
if __name__ == "__main__":
unittest.main()
總結
以上是生活随笔為你收集整理的python代码运行不了怎么办_selenium ide 生成的 Python 代码无法执行是怎么回事?的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: python创建子进程_Python--
- 下一篇: python读取txt为datafram