????b??????????κ?????????λ???
????driver.findElement(By.cssSelector("?????[??????='?????']"));
????c????????????

 

^=        driver.findElement(By.cssSelector("?????[??????^='xxx']"));  ??????????xxx????????
$=        driver.findElement(By.cssSelector("?????[??????$='xxx']"));  ??????????xxx??β?????
*=         driver.findElement(By.cssSelector("?????[??????^='xxx']"));  ????????????xxx?????

????2????????+·????????????????????????????????????????????????????
????driver.findElement(By.cssSelector("div#login>input"))   ?÷?????“div#login>input” ??????????·????λ??id?login??div?????????????????input??·????
???????????xpath??λ???????cssSelector??xpath??????????????λ??????????????????????????????????
????1?????·????λ???
????driver.findElement(By.xpath("/html/body/div/form/input"))
????2????????·????λ???
????driver.findElement(By.xpath("//input"))   ???????????????????????????
????3???????????λ??????????????1?????????????????
????driver.findElement(By.xpath("//input[2]"))   ???????????????????????????
????4??????????????λ???
????driver.findElement(By.xpath("//input[@id='username']"));
????driver.findElement(By.xpath("//img[@alt='flowr']"));
????5?????????????????????????λ????and??or
????driver.findElement(By.xpath("//input[@id='username' and @name='userID']"));
????6???????????????λ???
????driver.findElement(By.xpath("//input[@button]"))
????7????????cssSlector????ò??????????????

 

starts-with()    driver.findElement(By.xpath("//input[stars-with(@id??'user')]"))
ends-with        driver.findElement(By.xpath("//input[ends-with(@id??'name')]"))
contains()        driver.findElement(By.xpath("//input[contains(@id??"ernam")]"))

????8????????????????????
????driver.findElement(By.xpath("//input[@*='username']"))
????9?????xpath??????λ???
????????????????w3school.com
???????????innerText??λ???
????1?????cssSelector????innerText??λ???
????driver.findElement(By.cssSelector("span[textContent='????']"));
????2?????xpath??text????
????driver.findElement(By.xpath("//span[contains(text()??'hello')]"))   ???????
????driver.findElement(By.xpath("//span[text()='????']"))     ???