Need to find element in selenium by css

后端 未结 3 1957
暖寄归人
暖寄归人 2020-11-28 05:03

I want to find the element of this link \"us states\" in

. I am trying this in craigslist. Any help will be highly appreciated

Here is the ur

3条回答
  •  醉梦人生
    2020-11-28 05:24

    By.cssSelector(".ban") or By.cssSelector(".hot") or By.cssSelector(".ban.hot") should all select it unless there is another element that has those classes.

    In CSS, .name means find an element that has a class with name. .foo.bar.baz means to find an element that has all of those classes (in the same element).

    However, each of those selectors will select only the first element that matches it on the page. If you need something more specific, please post the HTML of the other elements that have those classes.

提交回复
热议问题