我的问题是关于使用dot和text()in的具体细节XPath.例如,以下find_element行返回相同的元素:
driver.get('http://stackoverflow.com/')
driver.find_element_by_xpath('//a[text()="Ask Question"]')
driver.find_element_by_xpath('//a[.="Ask Question"]')
Run Code Online (Sandbox Code Playgroud)
那么区别是什么呢?使用.和有text()什么好处和缺点?