cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
steve_o_44
New Member

Using TextList when parsing through website

Hi,

I am trying to look for specific words on a webpage. When I do a single If text doesn't exist on web page it works fine.

 

When I create a TextList and use:

Web browser instance: %Browser%

Check if web page: "Doesn't contain text"

Text: %TextList%

 

This does not work. I used "Add Item to List" and added several strings to the list. 

 

Am I doing something wrong or is there another solution to check for multiple strings on a webpage?

 

Thanks

Steve O

2 REPLIES 2
VJR
Super User
Super User

Hi @steve_o_44 

 

As you can see this action takes a Text and not a List or a Datatable type of variable.

Therefore you will need to loop through your List variable and pass each individual Text to the below box one by one within the loop. Code your logic such that if all Text from the List is found then return True if not then False.

 

VJR_0-1658979003243.png

 

rolign
Advocate III
Advocate III

Something like this (copy-paste in PAD):

 

Variables.CreateNewList List=> TextList
SET ContainsText TO $'''True'''
LOOP FOREACH ListItem IN TextList
IF (WebAutomation.IfWebPageContains.WebPageDoesNotContainText BrowserInstance: Browser Text: ListItem) THEN
SET ContainsText TO $'''False'''
END
END

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,110)