Python 2.7.6 (default, Mar 22 2014, 22:59:56)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> "hello world{}".format("end")
'hello worldend'
>>> "hello world {1} and {0}".format("a", "b")
'hello world b and a'
>>>
driver.find_element_by_css_selector("p[title=\"%s\"]" % appname).click()
或使用较新的样式字符串格式:
driver.find_element_by_css_selector("p[title=\{}\"]".format(appname)).click()
让我们用一种更像Python的方式来做。使用format函数。在
你的情况也是如此
^{pr2}$很少有reasons为什么你喜欢格式而不是百分比。在
相关问题 更多 >
编程相关推荐