您的位置:首页 > Web前端 > CSS

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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: