I'd like to download the primary parcel layer from this website.

First step is to click the "Add/Remove Item" button, but I am having trouble locating it. For this button, the Inspect Element window looks like this:

enter image description here

The relative XPath for this is


The absolute XPath for this is


I've tried using both by going:

driver.find_elemet_by_xpath("XPath as above")

I've also tried using its id:


but they did not work (NoSuchElementException).

What I want to do is to make sure that this button is "ON", in which case, the class name is

class = ........... is-in-collection

and if not, turn it on.

Originally I was going to locate the button and click it to turn it on, but if there is a way to check the status of the button, that's probably better, as this site seems to retain the setting from the last visit.

Can anyone please help me on this?

Thanks in advance.

1 Answer 1


There are several button with the data-dojo-attach-point='itemAddStateNode' attribute on you web page so make sure you are locating the correct one.

possibility is the number in id=K/widgets/Tooltipify_10 is dynamic it may change if number of component gets add on page

You can use combination of attribute in CSS selector as below


eg. Add Icon


Remove Icon


You can check the condition which one is currently displaying e.g

element = driver.find_element_by_css_selector("div[id='K/widgets/Tooltipify_10']>div[data-dojo-attach-point='itemAddStateNode']")
if element.is_displayed():
  print "Add Button is There"
  print "Element not found"

For Remove:

element = driver.find_element_by_css_selector("div[id='K/widgets/Tooltipify_10']>div[data-dojo-attach-point='itemRemoveStateNode']")
if element.is_displayed():
  print "Remove Button is There"
  print "Element not found"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.