Copy image path, if image exists on page

I’m running through an Excel file that has URLs in column A. For Each Row, the robot goes to the URL in column A, then I need it to copy the header on the page (H1). After that, I need it to check to see if there is an image on the page. If so, copy the image path. Is there a way to do this?

1 Like

@EMueller Yes you can copy image url by using Get Attribute activity and header you can get by Get Text activity

What if the page doesn’t have a header and/or an image? Right now the robot errors out if an H1 doesn’t appear on the page, but there is an H2. Is there a way to check for those elements, if they are not on the page, then go on to the next URL?

1 Like

Hey @EMueller
You can just refer this topic.

please mark it as a solution if it solves your query.


@EMueller You can use Element Exists Activity to check if the Element Exists first and then perform the operation but since this element can be any of the header tags we first might need to confirm all the header tags are present or not. For further checking we might need to look at the Page that you are referring which contains the tags and the image.

I guess using Find Children Activity on the Page, and checking if there is Header tag present in any of the UiElements can be a solution

Have you tried to check in this way?