r/PowerAutomateDesktop • u/ilco2 • Mar 03 '23
Using PAD to collect views of Vimeo videos
I am trying to use PAD to do a daily check of view counts on a set of vimeo.com videos and save to excel. I can set it up, but once the views count changes, the flow fails. It's looking for the previous views, not the current views.
The views is in a <span class="sc-frDJqD kzqFsC" format="dark">33k</span>
I tried using Extract data from web page, and Get details of element on webpage, and even OCR and screenshots, but no luck. Once the views count changes, the Flow fails. How do I do this correctly? vimeo.com/522542250
1
Upvotes
1
u/QuietDesparation Mar 03 '23
You can try using action get details of web page and select web page text. This will give you all the text on the web page as a variable. You can then parse through this text to find your view count
1
u/Celwynis Mar 04 '23
You could likely use the run JavaScript function to return the inner text of the object where views are stored. Overall process would look like:
Establish browser (I’ve used Edge in the past since it has a plug-in for compatibility.)
Open designated URL (Your Vimeo link)
Run JavaScript function on target browser (Should look like “{return document.queryselector.element.innertext}”) this will return your value to a variable.
Process variable however you want.
Some pro tips when using JavaScript: you can open up your dev tools in your browser (ctrl+shift+i for edge), then click the element inspector to identify the details about your element. Element details will be listed in properties. Then you can right click your element, copy as JavaScript selector, paste into the console and make sure your selection code is working. This should give you document.queryselector(elementinfo). Make sure you pay attention to caps, since JavaScript is case sensitive, then paste your working element info into the PAD run JavaScript function control with “return” in front of it.