You can watch this RPA Fridays webinar session here
This was ✓ RPA Challenge 5 - Explore new music - #5 by roman.hruska
And you can check the workflow with description in this thread
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
- Provide an input field for the user to pick a genre
- Download first 20 songs from the list
Solution
Open Browser - opens browser to work with (in this “Do” scope is enclosed all rest of the process) | |
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 and then click on the “Genres” in menu. In the source code, that will be shown in the Inspection panel, locate this line: and change the parameter style="display: none;" to style="display: block;" as it is in the picture . 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. |
|
Assign - convert first col. to array of string. Use LINQ: GenresDT.AsEnumerable().Select(Function(a) a(“Column1”).ToString).ToArray() | |
Input Dialog - set InputType to MultipleChoice and supply options variable as Options property. Save output to string selectedGenre. | |
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 | |
Navigate To - genre url | |
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. |
|
For Each - element from Find Children activity (for each download link) | |
Click - click download arrow - in properties, set Element to element (from For Each = placeholder variable) | |
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! | |
Click X - to close popup, and continue with next download button | |
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!