css selector: xpath:
2015-08-25 18:02
671 查看
css selector:
$$(".mainLeft>div>h1")
xpath:
$x(".mainLeft>div>h1")
name = selectText(".mainLeft>div>h1");
xingzhi = selectText(".comTinyDes>tbody>tr:nth-child(1)>td:nth-child(2)>span");
guimo = selectText(".comTinyDes>tbody>tr:nth-child(2)>td:nth-child(2)>span");
wangzhan = selectText(".comTinyDes>tbody>tr:nth-child(3)>td:nth-child(2)>span");
hangye = selectText(".comTinyDes>tbody>tr:nth-child(4)>td:nth-child(2)>span");
dizhi = selectText(".comTinyDes>tbody>tr:nth-child(5)>td:nth-child(2)>span").replace("查看公司地图","");
jianjie = selectText("div[class=part2]").replace("公司介绍","");
.css("ul[class=base_info]>li:nth-child(4)")
dizhi: $$(".lxfs>ul>li:nth-child(1)>font")
youbian: $$(".lxfs>ul>li:nth-child(2)>font")
lianxiren: $$(".lxfs>ul>li:nth-child(3)>font")
youxiang: $$(".lxfs>ul>li:nth-child(4)>font")
dianhua: $$(".lxfs>ul>li:nth-child(5)>font")
chuanzheng: $$(".lxfs>ul>li:nth-child(6)>font")
CSS selectors for Selenium with example http://seleniumeasy.com/selenium-tutorials/css-selectors-tutorial-for-selenium-with-examples
$$(".mainLeft>div>h1")
xpath:
$x(".mainLeft>div>h1")
name = selectText(".mainLeft>div>h1");
xingzhi = selectText(".comTinyDes>tbody>tr:nth-child(1)>td:nth-child(2)>span");
guimo = selectText(".comTinyDes>tbody>tr:nth-child(2)>td:nth-child(2)>span");
wangzhan = selectText(".comTinyDes>tbody>tr:nth-child(3)>td:nth-child(2)>span");
hangye = selectText(".comTinyDes>tbody>tr:nth-child(4)>td:nth-child(2)>span");
dizhi = selectText(".comTinyDes>tbody>tr:nth-child(5)>td:nth-child(2)>span").replace("查看公司地图","");
jianjie = selectText("div[class=part2]").replace("公司介绍","");
.css("ul[class=base_info]>li:nth-child(4)")
dizhi: $$(".lxfs>ul>li:nth-child(1)>font")
youbian: $$(".lxfs>ul>li:nth-child(2)>font")
lianxiren: $$(".lxfs>ul>li:nth-child(3)>font")
youxiang: $$(".lxfs>ul>li:nth-child(4)>font")
dianhua: $$(".lxfs>ul>li:nth-child(5)>font")
chuanzheng: $$(".lxfs>ul>li:nth-child(6)>font")
CSS selectors for Selenium with example http://seleniumeasy.com/selenium-tutorials/css-selectors-tutorial-for-selenium-with-examples
相关文章推荐
- css selector: xpath:
- 关于单选框以及复选框的css美化方法
- 当内嵌图层有图层样式时,如何在其上边创建图层剪切蒙版
- css中的float和相对定位,绝对定位,z-index
- Css font-family字体对照表
- 适度使用禁止复制css样式的好处
- CSS中border和clear两大属性用法揭秘
- DIV背景透明样式使用
- css知多少(5)——选择器
- css知多少(4)——解读浏览器默认样式
- css样式,层叠顺序属性z-index
- Silverlight渐变样式
- CSS100%布局小事例
- css知多少(3)——样式来源与层叠规则
- 博客园CSS代码
- CSS实现垂直居中
- css Reset
- CSS初始化设置
- 读The CSS Box Model有感
- CSS3.0中content格式的图标不显示