class BaseTest(unittest.TestCase):
@classmethod
def setUpClass(cls):
fire_fox_user_agent = "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:53.0) Gecko/20100101 Firefox/53.0"
dcap = dict(DesiredCapabilities.PHANTOMJS)
dcap["phantomjs.page.settings.userAgent"] = fire_fox_user_agent
cls.browser = webdriver.PhantomJS(desired_capabilities=dcap)
设置 PhantomJs 的 User-Agent 的方法
最新推荐文章于 2024-06-13 16:44:00 发布