cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Tobias_S
Advocate I
Advocate I

Parse text from website using CSS Selector

Hello community,

 

I am a little stuck while trying to parse a text field from a web site.

 

How to use the CSS Selector for this? Does anybody have experience?

 

While inspecting the website, I get the following content:

Tobias_S_0-1647440124115.png

 

The respective element (text) is the following:

Tobias_S_1-1647440124117.png

 

How to fill the following fields with the information above to grab a "single value" (the text)?

Tobias_S_2-1647440326240.png

 

Can someone please help me out?

1 ACCEPTED SOLUTION

Accepted Solutions
VJR
Super User
Super User

Hi @Tobias_S 

During the extraction you can right click on the element you want and then get its Text and the CSS will automatically be generated for it.

This video could be of help. If you don't need a table just extract it only once.

 

View solution in original post

4 REPLIES 4
ChristianAbata
Super User
Super User

hi @Tobias_S  first you need to add javascript action. Then

 

function ExecuteScript() { document.querySelectorAll('CSS-Selector').class }

 

Use queryslector to select the component and change the last propertie trying to get the value behind that component



Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA
VJR
Super User
Super User

Hi @Tobias_S 

During the extraction you can right click on the element you want and then get its Text and the CSS will automatically be generated for it.

This video could be of help. If you don't need a table just extract it only once.

 

I used the right click. But there is no rectangle on the text field but on the field around (including the headline of the text field). The text itself is not able to be grabbed alone. It is the only field on the website making trouble. Another field next to the problem making area having the same "settings" is divided in "box: headline + text" or "text only". Here I can right click and name the field correctly.

So I tried to find it with Edge Website Inspector.

 

I will try what @ChristianAbata explained and come back with the results.

Tobias_S
Advocate I
Advocate I

In the meantime I found a solution: using the subtext function to recude the fixed text from the variable text that I want to grab 🙂

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Top Solution Authors
Top Kudoed Authors
Users online (3,189)