yyyyyyyyyyyyyyyyyyyy

博客园 首页 新随笔 联系 订阅 管理

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

posted on 2015-08-25 18:02  xxxxxxxx1x2xxxxxxx  阅读(148)  评论(0编辑  收藏  举报