selenium学习文档
https://selenium-python.readthedocs.io/
用例的关键要素:
例子:
https://testerhome.com/
import selenium from selenium import webdriver from time import sleep class TestHgeWzi(): def setup(self): #初始化 self.driver = webdriver.Firefox() self.driver.maximize_window() self.driver.implicitly_wait(5) #回收资源 def teardown(self): self.driver.quit() def test_hogwads(self): self.driver.get("https://ceshiren.com") self.driver.find_element_by_link_text("社团").click()