Can I use CSS selector in a modal which its HTML is not included in the original web page where auto-pilot to show the modal starts?

Hi,

Summary

I want to use auto-pilot in a website to show a form modal and use CSS selector({site:text; selector=.name}) to retrieve info from the modal that its HTML is not included in the original web page where auto-pilot starts, but did not work.
The original web page shows a list of person and button for each to show a form modal to send message to them. I want to send a message to them one by one automatically.

Situation

The modal's HTML is not included (in the inspect view) in the web page where auto-pilot starts. During the auto-pilot, a button is clicked and the modal appears. Then, within the modal, CSS selector {site:text; selector=.name} runs to retrieve name shown in the modal, but [Error - No match found for selector: ".name ".]"Error: is output.

When I click the button and show the modal manually and run CSS selector within the modal (the modal's HTML is shown in the inspect view) CSS selector works, retrieving the name element from the modal.
I guess if you trigger CSS selector by auto-pilot, CSS selector loads HTML where auto-pilot starts.

Snippet:/auto-pilot
{repeat: 10}{key:tab}{endrepeat}
{click}               #click the button to show the modal
Hi {site: text; selector=.name},     #retrieve info from the modal
Nice to meet you!

Output: [Error - No match found for selector: ".name ".]"Error: 

I tried

I separated CSS selector part to another snippet and imported this snippet to the auto-pilot snippet but did not work, neither.

Snippet: /getname
{site: text; selector=.name}

Snippet: /auto-pilot
{repeat: 10}{key:tab}{endrepeat}
{click}
Hi {import: /getname},
Nice to meet you!

Output: [Error - No match found for selector: ".name ".]"Error: 

Is there something else that I can try?

Hi,

The {site} command uses the state of the page as it exists at the start of insertion. Any changes to the page that occur after that will not be reflected in the {site} contents.

Cheers, Scott

Understand. Thank you!

I am trying to find out what is the correct command to select the Name (which is carol) from this HTML

<div class="recipients-token">
carol <a href="#" class="j-remove"><i class="icon icon-x"></i></a>

Jay

Got it working. Very simple..

Hi {site: text; selector=.recipients-token},
1 Like

@Jay_Janarthanan - on a side note, Text Blaze also supports regex strings. There's a collection of commands that allow you to do some really cool stuff with regex.