RPA Fridays #2 - Download new music (step by step)

You can watch this RPA Fridays webinar session here :goggles: :partying_face:

This was ✓ RPA Challenge 5 - Explore new music - #5 by roman.hruska

And you can check the workflow with description in this thread :slight_smile:

RPA Fridays #3 - Download new music

Assignment

This challenge may not only widen your UiPath skills, but also your musical horizons! This time the goal is:

  • Go to FMA website
  • Scrape genres
    image
  • Provide an input field for the user to pick a genre
  • Download first 20 songs from the list

Solution

image Open Browser - opens browser to work with (in this “Do” scope is enclosed all rest of the process)
image Using Data scraping wizard can get tricky since you will soon realize that the Genres menu keeps hiding from you. One little trick will solve this. In the browser, click F12. This will display the Inspection panel. Click this icon obrazek and then click on the “Genres” in menu. In the source code, that will be shown in the Inspection panel, locate this line: obrazek and change the parameter style="display: none;" to style="display: block;" as it is in the picture :slight_smile:. The sub-menu is now visible and will be unless you hover over it and move your cursor away. Then you have to repeat it. Make sure you tick the Extract URL option in the wizard. Stores result as data table GenresDT.
image Assign - convert first col. to array of string. Use LINQ: GenresDT.AsEnumerable().Select(Function(a) a(“Column1”).ToString).ToArray()
image Input Dialog - set InputType to MultipleChoice and supply options variable as Options property. Save output to string selectedGenre.
image Assign - get the url - extracts the URL from data table GenresDT to a string based on genre. So: GenresDT.Select("[Column1] = ‘"+selectedGenre+"’")(0)(1).ToString
image Navigate To - genre url
image As for this website, data scraping does not really work for the download buttons, I use Find Children activity, where Selector is the whole area with the songs and Filter parameter is set as: "<webctrl aaname='Download' tag='A' />" This gives me all the UiElements of the download arrows.
image :arrow_down: For Each - element from Find Children activity (for each download link)
image Click - click download arrow - in properties, set Element to element (from For Each = placeholder variable)
image Inside Wait For Download put activity Click understand and agree to click to start the download. This will wait until the download is done. Very good!
image Click X - to close popup, and continue with next download button
:arrow_up: End of For Each

Download this project

RPA_Fridays_02.zip (318.9 KB)

If you have any issues, please reply in this thread!
Happy automation! :minidisc: :guitar:

5 Likes

I really like the idea. What a usefull robot. Can you make a robot that will download songs from Youtube?

2 Likes

Hey @Katerina.Spurna , thank you :slight_smile:
For sure you can! You may utilize some of the download tools and come with some automation that will help you with it. However, keep in mind, you may cross some copyright laws here. :wink:
Roman

1 Like