Module13-Extracting objects from specific page using CSS sel | Selenium Forum
M
Posted on 18/08/2016
This is working fine with Xpath:
d.findElement(By.xpath("//*[@id='page']/section[3]/div/div/section[1]";

when tried to convert above to CSS selector, error message is displayed

d.findElement(By.cssSelector("*[id='page'] section:nth-child(3) div div section:nth-child(1)"));

can you please help me with correct cssselector

M
Replied on 22/08/2016

which website is this?


M
Replied on 22/08/2016

http://www.bbc.com/

Responsive image

M
Replied on 22/08/2016

id="page" is wrong. id is #

use this

[code:2fdz61cq]#page > section.module.module--compound.module--news-sport > div > div > section.module.module--news.module--collapse-images[/code:2fdz61cq]