日期:2014-05-17 浏览次数:21164 次
比如:找到页面中,找到一组 <a>, 然后再找到[2].parent()这个dom, jQuery得心应手,selenium 之前则只能借助于晦涩难懂的 xpath.? >_<
The CSS locator strategy uses CSS selectors to find the elements in the page. Selenium supports CSS 1 through 3 selectors syntax excepted CSS3 namespaces and the following:
| 
 
  | 
 
  | 
| 
 
  | 
 
  | 
| 
 
  | 
 
  | 
| 
 
  | 
 
  | 
| 
 
  | 
 
  | 
| 
 
  | 
|
| 
 
  | 
|
| 
 
  | 
|
| 
 
  | 
|
| 
 
  | 
css=div[id="pancakes"] > button[value="Blueberry"]
 selects the button with its value property set at Blueberry
 if children of the pancakes
 div
PROS :
CONS :