python代码运行不了怎么办_selenium ide 生成的 Python 代码无法执行是怎么回事?
用的是 firefox 的 selenium ide
我隨便測(cè)試一個(gè)代碼就是點(diǎn)開(kāi)了一個(gè)連接然后生成下面的代碼但是無(wú)法運(yùn)行,
提示ImportError: cannot import name 'selenium' 感覺(jué)是很老的代碼了, 這個(gè)代碼應(yīng)該怎么處理才能正常的使用?
# -*- 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()
總結(jié)
以上是生活随笔為你收集整理的python代码运行不了怎么办_selenium ide 生成的 Python 代码无法执行是怎么回事?的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: python创建子进程_Python--
- 下一篇: python读取txt为datafram