How to fetch the innerText of a <dd ...>-element belonging to <dt ...>-element

I am looking for the best practise how to fetch the innerText of a <dd … class=“field-value”>-element which belongs to a

-element from which the innerText is tracked the GetAttribute-activity.

In other words, I need to scrape the text value from a <dd … class=“field-value”>-element [Green-box] which belongs to a <dt … class=“field-label”>-element [Yellow-box]. These, related to each other element-set is fit within a

which itself can be seen as a row within a <dl … class=“fields”>-(list)-element.

I am able to fetch the innerText of the desired <dt …>-(term)-element [Yellow box] with a GetAttribute-activity within the <dl …>-(list)-element. However, this term is merely the fifth list (row) item (pict one), however on ocassion is it the fourth list (row) item (pict two) in case the first list (row) item does not exists.

Every hint, video (tutorial) of example is welcome.

Every hint, video (tutorial) of example is welcome.

You should look into the Find Children activity. You can use it to get an enumerable of all the objects with class=“field-*” and then loop through them.

@van-der-kamp
welcome to the forum

as the div element is parent to the dt and dd element you will have a chance to extract it with the help of data scraping (Table extraction , newer version)

as alternates we do have find children as mentioned above

:+1: Peter! I’will dive into ‘Table extraction’!

:+1: Paul! I’ll dive into GetChildren-activity!

Note that it is generally necessary to set it to “descendants” so it’ll dig into the hierarchy.

perfect, pay attention when configuring the correlated data is done within the wizard steps

Paul, your direction delivers me already 4 videos to look at, thanks!

Peter, your direction delivers as well 3 videos including one of Anders Jensen, thanks!

kindly note: in case of URL is public feel free to share it with us. So we can help also more individually

Url: Marcanet
Its an open data portal (as stated at the bottom banner).
Click > Opciones avanzadas > 1) in box ‘Escriba el nombre…’ : xxxxxxx, 2) in ‘Clase de Niza’: yy and 3) in box 'Elige #… first select ‘Registro international’ and store the same number as in 1), then hit button [Buscar] > on the result page click link ‘registrada’, next, on the result detail page in section ‘Datos generales’ the date related to ‘Fecha de concesión’ needs to be fetched, the sixth row in case of the first parameter set (see below), however on certain occasions (with the other set of ‘nombre’ and related ‘clase’) the section ‘Datos generales’ does not have a ‘Denominación’ and the robot clicks on the row below instead of the ‘Fecha de concesión’ row, meaning the ‘Fecha de terminación’ value is scraped instead of the ‘Fecha de concesión’ value

Escriba el nombre Clase de Niza
(xxxxxxx) (yy)
1008952 35 (six rows)
1201873 32 (five rows)

a quick check looks good
https://marcia.impi.gob.mx/marcas/search/details/NC198600000123?s=a737232a-5fdc-4d0b-bda2-abfc5968322b&m=l&fs=REGISTRADO

Extract data XML before optimization
grafik

Thanks Peter, however way passed bedtime, I’m tired… tomorrow!

Thanks Peter, I hardly slept, ha! You pushed me in the right direction, I managed to scrape a table with Data Scraping Tool (main ribbon), see
3

It is worth to mention, using the Data Scraping Wizard (Main Ribbon), it was a ‘pain in the xyz’ to point to the correct element, that was a real gamble game. I didn’t stop throwing pointers at my screen,. Finally I succeeded! Next step will be filter for the correct row to map the term what I’m looking for and fetch its related value.

When you get more experience with selectors, you can often write them yourself by inspecting the HTML and figuring out the parent container manually.

Thanks Paul, I think you right!

can we finalize the topic?

Peter, thanks, you may finalize the topic!

As filter I implemented an AssignOperation activity to assign a FilteredDataTable to fetch the value related a term in the terms list in the ExtractDataTable through ExtractDataTable.Select(“[]=‘’”).CopyToDataTable(), next the subtracted KVP (the filtered row) is the key: FilteredDataTable.Rows[0][0].ToString() and the value: FilteredDataTable.Rows[0][1].ToString().

ok. let us know if need further help. Best would be that you will create a new topic for it.
Happy Automation

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