Trying to select a disabled class

Site is: Recreation.gov - Camping, Cabins, RVs, Permits, Passes & More

I have a macro that runs and selects options on the calendar: Type of Camping (overnight), Date (7/22), Guests (2)

Currently there are no reservations, and there is no element to select in the visual selector. In Chrome I inspect it, and it’s a disabled class.

If you could help me out with what exactly to type…I just need to get notified if that button becomes available to select/becomes something other than zero.

Thank you!

I’m not much of a coder, so this is a bit difficult for me.

2023-07-20 09_44_02-Untitled - Paint

Hello @armadillon, welcome to the forum.

When using the Visual Selector, are you able to select the element that contains the disabled button? If yes, can you save that selection and share the config with me? I can then try to show you how to modify the selection and its settings.

I could only select the following (John Muir):


(//div[@id='page-content']//div//div[contains(@class,'sarsa-stack')]/div[@class='sarsa-box']//div//div[@role='grid']/div[@role='row']/div[@role='gridcell'])[133]

Then I expanded once like so (entire row selected):


(//div[@id='page-content']//div//div[contains(@class,'sarsa-stack')]/div[@class='sarsa-box']//div//div[@role='grid']/div[@role='row'])[13]

This is the button next to it, which IS selectable, but this is not the date I need:


(//div[@id='page-content']//div//div[contains(@class,'sarsa-stack')]/div[@class='sarsa-box']//div//div[@role='grid']/div[@role='row']/div[contains(@class,'available')]//button[contains(@class,'sarsa-button')])[102]

For the data I need, my cursor shows that I am unable to select the element I need, the grey box with the zero:

Hopefully not an overload of information/images, but did an inspect on the boxes in Chrome for you:

Thanks for the detailed information.

I changed the number 102 in the XPath to 101 to update the XPath to the following:

(//div[@id='page-content']//div//div[contains(@class,'sarsa-stack')]/div[@class='sarsa-box']//div//div[@role='grid']/div[@role='row']/div[contains(@class,'available')]//button[contains(@class,'sarsa-button')])[101]

This selects the disabled button and monitor’s its count of available slots for changes. Can you try using this and see if this works for your use case?

We will also look into making selecting disabled buttons easier.

I THINK it’s working, but I really won’t know unless a spot opens up, of course. Which, it may never actually open up OR a spot may open up in the permit reservation system and then it would quickly get booked.

I’ve tested my Macro out and it works, but hopefully it does see the button.

I really appreciate your assistance on this! It’s truly a clever Chrome extension.

1 Like

As a test, try monitoring a larger section. Selecting the full row or multiple rows could trigger a change sooner.