-1

I am trying to use Selenium to get all element in the list ::before pseudo-element. I can't save data into the list.

Scenario: I want to all data into the list where data in li and a tag

Here is what the DOM looks like:

enter image description here

I am using selenium + python

This code is hovering to main category nav 'Women':

element_to_select = driver.find_element_by_xpath("//*[@id='nico-main-header']/nav/ul/li[1]")
hover = ActionChains(driver).move_to_element(element_to_select)
hover.perform()
driver.implicitly_wait(15)

Print all li achor tag :

ele = driver.find_element_by_css_selector("ul .row .col-md-3:first-child ul li")

print(ele)

** but li anchor tag is not coming while printing the ele.

Mohit Jaiswal
  • 49
  • 1
  • 4
  • Can you please post the code which you have already tried? – Knu8 Mar 12 '20 at 10:25
  • This code is hove to main category nav: element_to_select = driver.find_element_by_xpath("//*[@id='nico-main-header']/nav/ul/li[1]") hover = ActionChains(driver).move_to_element(element_to_select) hover.perform() driver.implicitly_wait(15) Print all li achor tag : ele = driver.find_element_by_css_selector("ul .row .col-md-3:first-child ul li") print(ele) – Mohit Jaiswal Mar 12 '20 at 10:30
  • Please post the selenium code it whatever programming language you are trying java, python or javascript. – Knu8 Mar 12 '20 at 10:34
  • I am using python + selenium. – Mohit Jaiswal Mar 12 '20 at 10:35