How to extract elements from html page web

HELLO EVERYONE
I have a probleme when i tried to extract some information in an html web page using http request and i specify the wanted text with the extract text activity using start and end text
this is the link and i want extract all the names of companies Companies included in the 2021 Bloomberg Gender-Equality Index:
https://www.bloomberg.com/company/press/bloombergs-2021-gender-equality-index-reveals-increased-disclosure-as-companies-reinforce-commitment-to-inclusive-workplaces/
so if any one knwew how to do this

Hi @Lounis_Merabet1 ,

You can use get attribute to fetch the value of aaname that produces all the companies in a string. Please check the xaml below:
ExtractDataFromWebsite.xaml (80.2 KB)

i don’t have access to the document
they say that is private
please send again

Can you share me the screenshot of the private issue.

1. Using Screen Scraping:

This method is suitable for simpler scenarios where you want to extract specific pieces of data based on their visual location on the webpage.

  • Use the “Screen Scraping” activity: Drag and drop this activity onto your UiPath workflow designer.
  • Indicate the target area: Use the designer to visually indicate the area on the webpage that contains the elements you want to extract. UiPath will automatically generate a data scraping structure based on the identified elements.
  • Customize data extraction: Refine the generated structure to specify which elements you want to capture (text, attributes, etc.). You can use selectors like “InnerText” or “InnerHtml” to define what data to extract.

2. Using HTML Agility Pack (For More Complex Extraction):

For complex HTML structures or dynamic content, Screen Scraping might not be efficient. Here’s how to use the HTML Agility Pack for more control:

  • Install the “UiPath.HTML.Activities” package: This package provides activities to interact with HTML content.
  • Use the “Get Web Page” activity: This activity retrieves the HTML source code of the webpage.
  • Use the “Parse HTML” activity: This activity parses the retrieved HTML into a document object.
  • Navigate the HTML structure: Use activities like “Select By XPath” or “Select By CSS Selector” to target specific elements within the parsed HTML document.
  • Extract data: Use activities like “Get Text” or “Get Attribute” to extract the desired data from the selected elements.

@Lounis_Merabet1
This sequence extracts all the names of the company try this sequence in your project and let me know if this works for you
Happy Automation!!
Sequence.xaml (11.6 KB)

1 Like

yes it work
but are you modifying the properties of the selector or not and can you ive me advices for the cases like that
if i want to extract some informations from a web page i will use this activity or there is another one’s
thank you

1 Like

please if ther is a whats’up community in UiPath i want to join to get more information about rpa

i have just taken attributes of the element which stores this information. you can use this when you want information from that element.

You can join UiPath Chapter according to your location you might get group info if they have WhatsApp group.

or you can ask me on Instagram / LinkedIn

https://www.linkedin.com/in/chandreshsinhjadeja/

how do you know those elements
i serch with inspect element but i dont have seen this
???
how you do this

directly check the value you want in that activity if you get that value in that attribute then that’s the property you need

1 Like

how to devide into a list to have each company lonly?

You can use String.split
Please create new topic for this issue

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.