0

I'm working with Selenium in Python. I want to extract all id and parid values (I don't even know what parid means).

<li class="left_nav-li child" id="7012" onclick="getProductsFromCategory(this)" parid="7011">xxx<div class="submenu"></div></li>

I have a lot of this kind of element.

Boris Verkhovskiy
  • 14,854
  • 11
  • 100
  • 103
Sht
  • 179
  • 1
  • 1
  • 9
  • Does this answer your question? [How to get attribute of element from Selenium?](https://stackoverflow.com/questions/30324760/how-to-get-attribute-of-element-from-selenium) – Gaj Julije Mar 23 '21 at 14:31

1 Answers1

0

Use get_attribute: https://www.geeksforgeeks.org/get_attribute-element-method-selenium-python/

element.get_attribute("attribute name")
DMart
  • 2,401
  • 1
  • 14
  • 19