Ext.: http://www.imdsx.cn/index.php/2017/07/27/css1/
What is CSS Selector?
CSS selector positioning is actually the HTML CSS selector tag positioning
Tools
Css Selector's exercises suggest that you install Firefox, download plugins, Firefinder or Firebug and firepath combinations.
How to use CSS Selector
1, CSS selector support ID, class positioning and HTML in the same position as Css
# Number table ID positioning label with ID is more concise # I1 the label that represents class positioning has an ID is more concise. C1 class positioning also provides multiple class positioning through continuous. To narrow the range. C1.c2.c3
2, CSS selector support tag positioning no eggs
Same as CSS support tag Selector, but there is no use, a page repeat the label too many positioning methods: directly enter the label name
3. CSS selector supports arbitrary attribute positioning
The property is positioned in the same way as the CSS, with a direct bracket, plus a property on it [name='N1']
4, the property positioning is not enough to meet our positioning needs, CSS selector provides a combination of tag attributes positioning
Same as CSS positioning the same as our Tag property selector input[name='N1') when used in combination with ID, class, it is easier to write the class INPUT.C1 ID input#i1
5. CSS Selector provides multi-attribute combination filtering
CSS Selector Multi-attribute combination selection filter without and only need multiple [] connections can select[name='city' [size='4'] [multiple="multiple"]
6, the same CSS selector also support hierarchical relationship positioning
Different Css selector with XPath by > to differentiate the hierarchy of select>option[value='3']
7. Css Selector Fuzzy Matching
^= matches the element attribute with what start input[value^=" login "] $= match attribute with what end input[value$= " Record " ] *= Match property contains what value input [value*=" ]
We are not more sharp than the Dragon Slayer sword?
After all, leaning on the Sword and Dragon Slayer DAO is not common people can use, if the Dragon knife and leaning sword waving not up, there is a simple artifact, Selenium Builder.
Selenium Easter Egg-css selector How to use