Mrrrr's Forum (VIEW ONLY)
Un forum care ofera solutii pentru unele probleme legate in general de PC. Pe langa solutii, aici puteti gasi si alte lucruri interesante // A forum that offers solutions to some PC related issues. Besides these, here you can find more interesting stuff.
|
Lista Forumurilor Pe Tematici
|
Mrrrr's Forum (VIEW ONLY) | Reguli | Inregistrare | Login
POZE MRRRR'S FORUM (VIEW ONLY)
Nu sunteti logat.
|
Nou pe simpatie: andrum94 la Simpatie.ro
 | Femeie 24 ani Galati cauta Barbat 27 - 80 ani |
|
Mrrrr
AdMiN
 Inregistrat: acum 19 ani
Postari: 2364
|
|
I want to learn Power Automate Desktop (PAD), and to do that I've started a few training projects on my own.
For one of them, in Excel column A there are some movie names (just names, no years).
In the following columns I want to extract the last 3 Genres of the movie, the main actors, the rating as number, and the IMDB main link - https://www.imdb.com/title/ttXXXXXXX/
The flow described below might not be the most efficient - I am learning. I will add the Action -> Resulting variable, and number the steps with the same numbers as in PAD. If any more details, I will include on the next line under the same step.
UI elements were picked manually. If IMDB changes details in their pages, most likely the UI elements will not return the desired data anymore. Further comments for some steps are between curly brackets, e.g. {comment here}. They are comments just in this post, to give clarity - they do not appear in PAD.
Here goes:
1. Attach to Running Excel -> ExcelInstance
2. Get active cell on Excel worksheet -> col, rw
3. Read from Excel worksheet -> Movie Excel instance: %ExcelInstance% Retrieve: The value of a single cell Start column: %col% Start row: %rw%
4. Launch new Chrome -> Browser Initial URL: https://www.imdb.com/find/?q=%Movie%&ref_=hm_nv_srb_sm
5. Click link on web page UI Element text: div[Id="__next"] > main > div > div > section > div > div > section > div > ul > li > div > div > div > div > div > div > ul > div > a > h4 {would be best to select element with Ctrl+Click from the actual webpage}
6. Get details of web page -> URL Web browser instance: %Browser% Get: Web browser's current URL address
7. Get details of element on web page -> Rating Web browser instance: %Browser% UI Element text: div[Id="__next"] > main > div > section > section > div > section > section > div > div > div > div > a > span > div > div > div > span {would be best to select element with Ctrl+Click from the actual webpage}
8. Get details of element on web page -> Genre Web browser instance: %Browser% UI Element text: div[Id="__next"] > main > div > section > section > div > section > section > div > div > div > section > div > div:eq(1) {would be best to select element with Ctrl+Click from the actual webpage}
9. Get details of element on web page -> Actors Web browser instance: %Browser% UI Element text: div[Id="__next"] > main > div > section > section > div > section > section > div > div > div > section > div > ul > li > div:eq(2) {would be best to select element with Ctrl+Click from the actual webpage}
10. Replace text -> URL Text to parse: %URL% Text to find: /?ref_=fn_t_1 Replace with: /
11. Split text -> TextList Text to split: %Genre% Delimiter type: Custom Is regular expression: ON Custom delimiter: (?=[A-Z][a-z]) {splits the Genre by capital letter, because the grabbed UI Element consisted of "merged" text, e.g. FamilyDramaBiography}
12. Set variable -> count Value: %TextList.Count% {counts the items in the list; their index starts from 0 so the last item in the list is actually the value of count variable minus 1}
13. Set variable -> Genre Value: %TextList[count - 3]%, %TextList[count - 2]%, %TextList[count - 1]% {last 3 genres from the list}
14. Replace text -> Actors Text to parse: %Actors% Use regular expressions for find and replace: ON Text to find: \r?\n Replace with: , {comma and a space after it}
15. Convert text to number -> Rating Text to convert: %Rating%
16. Write to Excel worksheet Excel instance: %ExcelInstance% Value to write: %Genre% Write mode: On specified cell Column: %col + 1% Row: %rw%
17. Write to Excel worksheet Excel instance: %ExcelInstance% Value to write: %Actors% Write mode: On specified cell Column: %col + 2% Row: %rw%
18. Write to Excel worksheet Excel instance: %ExcelInstance% Value to write: %Rating% Write mode: On specified cell Column: %col + 3% Row: %rw%
19. Write to Excel worksheet Excel instance: %ExcelInstance% Value to write: %URL% Write mode: On specified cell Column: %col + 4% Row: %rw%
20. Activate cell in Excel worksheet Excel instance: %ExcelInstance% Activate: Absolutely specified cell Column: %col% Row: %rw + 1%
21. Save Excel -> ExcelInstance
22. Close web browser Web browser instance: %Browser%
Optionally, instead of steps 12-13, you can use one step but it requires manual interaction with the items from TextList - manually selecting the desired genres. The Action is called "Display select from list dialog".
_______________________________________

|
|
| pus acum 17 ore |
|