Searching a webpage for email address

I’m trying to scrape email address from this webpage (the email is located in footer’s page). In other cases, I need to navigate to “Contact” page in order to search for email address. Can you help me to improve my knowledge about?

Testing file:
Greece.xaml (20.4 KB)

Hi Thomas,

I have attached a process that does exactly what you have described. Make sure you have the UiPath.UIAutomations.Activities package installed. I noted what each activity does. If you have any questions, just let me know.
Main.xaml (18.8 KB)

2 Likes

Interesting approach… I’m working on your idea of using Regex to make it able to scrape from other websites too.
Could you help me, please, to figure out how to search/detect a general website for “Contact” button/page?

What I did so far:

  • scrape the email address
  • searching for CONTACT button… not working yet (played with “Find children” (Find decendants). I’ll need some help here!

File update:
Example_source - hotel short - Contact button.xaml (18.3 KB)
I’ve change IF Condition from footerEmail.Count > 0 to footerEmail.Count = 0 just to trigger Find Cildren/Contact button sequence (where I’m working to search the Contact button).

Updated file (got some URLs now… but not from Contact button):
Example_source - hotel short - Contact button.xaml (19.3 KB)

Sorry I had a work event yesterday so I just saw your replies. Did you try a find element activity to locate the contact button. Let me know if that works or not.

Thanks

Glad to have you back! :slight_smile:

I tried with Find Element but without success because my lack of understanting of Uipath exported variable type and conversion of it to be used/invoke in a IF activity. If you’ll have time to create a small demo will help me a lot or to point me in the right direction to learn how to create an IF loop based on IF (Find Element).

Hi Thomas,

I had to take a different approach with this task. To run this make sure you have the UiPath.WebAPI.Activities package installed. Let me know if this helps or not.

Thanks
Main.xaml (24.2 KB)

Got this error:

HTTP Request: Could not find a part of the path 'C:\Users\pbartlett\Documents\UiPath\Email_Scrape\source'.

Do I need that “source”?

Updated: it seems that I would need also “source” file…
Updated: fix it, the file is working well: I’ve got the url in Message Box. I’ll try to apply to my project to see implement your idea. I’ll be back with updates. Thanks!

Change the location of the source file on the Write Text File activity, to a location on your pc.

I did, for Udemy.com it’s working well.
But if I change the URL/website then cannot find the “contact” page and it througs this error:

Log Message: Object reference not set to an instance of an object.

Other url for testing:
https://www.artemisiapalacehotel.it/
http://romana.hotelduke.ro/
https://www.atlantehotels.com/

That error come from Matches activity when “contactLink” variable remains empty.

Question: how can I check if Matches activity successed or not (stored something in “contactLink” var or not) ?

Tested: I’ve tried to create an IF activity in order to learn if Matches activity successed or not (stored something in “contactLink” var or not) but I failed (not know how to check this type of var).

UPDATE: I’ve manage creating IF action to isolate the case of no email address found case.

contactLink.Count > 0

I’ll move on trying to create few other solutions in order to capture email address and jump from one to another based on IF activity.

1 Like

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