cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Unable to select UI element on Google Trends page (Chrome, Edge, FireFox)

Hi, I am using Launch New Browser (Chrome, Edge, FF) to navigate to this below URL.

 

https://trends.google.com/trends/explore?date=2020-01-01 2020-12-31,2019-01-01 2019-12-31,2018-01-01 2018-12-31&geo=US,US,US&q=how to cook ramps,how to cook ramps,how to cook ramps

 

On the page, I am trying to click this down arrow "download" icon so that I can initiate the download of the CSV file.  I tried using Click UI element in window, Click link on web page, Click download link on web page but none of them seems to identify that specific element (highlighting in red box).  In fact, it only puts red box on the whole page as "Document" and won't let me select anything else on the page.  I've tried recorders as well.  

 

How can I select the UI element on this Google Trends page?

Thank you so much for your help!!

 

t5p_0-1617374433681.png

 

50 REPLIES 50
Anonymous
Not applicable

@DamoBird365   Thank you so much for your help.  This is an awesome forum!!  Thank you!!

Anonymous
Not applicable

Not sure why, but it does not work anymore.  Maybe the selector is getting confused with other download elements?  

 

t5p_1-1617461928691.png

Robin.Core.ActionException: Click failed (failed to get UI element)
at Robin.Modules.UIAutomation.Actions.ClickElementInWindow.Execute(ActionContext context)
at Robin.Runtime.Engine.ActionRunner.RunAction(String action, Dictionary`2 inputArguments, Dictionary`2 outputArguments, IActionStatement statement)

t5p_2-1617461979016.png

 

Anonymous
Not applicable

JavaScript worked if I use the existing instance of Chrome.  If I do new instance, it throws an error.  I need to find the right and reliable combination I suppose.  Thanks.

t5p_0-1617462375006.png

 

The selector might be wrong, strange ordinals. Don't use UI automation when you can use web automation. 


--
Was this helpful? Then give it a thumbs up and/or select it as the solution!
Anonymous
Not applicable

Thank you @fraenK .  I don't see Click element action under Web automation.  Which action should I use?

Anonymous
Not applicable

Oh, Press button on web page!!??  trying that now

Anonymous
Not applicable

Oh are these all UI element actions??  going back to the earlier posts.  Maybe I completely missed the nomenclature...

t5p_2-1617463411519.png

 

burque505_0-1617465145732.png

 

 

hi @Anonymous , I think the problem here is that you're launching Chrome again each time through the loop and navigating to 'CurrentItem'. You might try moving the Chrome launch back up out of the loop and navigating instead to

 

 

https://trends.google.com/trends/explore?date=2020-01-01 2020-12-31,2019-01-01 2019-12-31,2018-01-01 2018-12-31&geo=US,US,US&q=how to cook ramps,how to cook ramps,how to cook ramps

 

 

just like before. Seems to me it should work then.

As @fraenK pointed out before, there's more than one button with that title. If you use this

 

 

function ExecuteScript() {document.querySelector("div[class='fe-multi-heat-map-generated fe-atoms-generic-container'] button[title='CSV'] i[class='material-icons-extended gray']").click(); }

 

 

there's only one such button.

Also (my 2 cents' worth), although others may feel differently, there is no reason in the world for you not to use Javascript, VBScript, Powershell, Python or any other scripting language that PAD can handle, as long as a) it's easier than one of the alternatives and b) it works and c) it works repeatably and reliably.  Scripting capability is there for a reason.

Microsoft recognizes this. See PAD scripting. 

Just add a new UI element (browser) and click the button and then modify the selector, liked mentioned way earlier: https://powerusers.microsoft.com/t5/Power-Automate-Desktop/Unable-to-select-UI-element-on-Google-Tre...

 

I would advise you to go trough the Power Automate Desktop basic training: https://docs.microsoft.com/en-us/learn/modules/pad-power-automate-desktop-development-essentials/

 

@burque505 In RPA you try to avoid 3rd party scripting as much as possible, because it adds complexity, which is very hard to manage. Scripting support is there to reuse existing scripts, when you migrate from earlier solutions or if there is something you can't handle with the built-in functionality/without scripting.

 

This challenge here is so **bleep** easy to solve with the built-in functionality.


--
Was this helpful? Then give it a thumbs up and/or select it as the solution!
Anonymous
Not applicable

Thank you both, @fraenK and @burque505 .  I appreciate both point of views equally and respectfully.  I use UiPath Studio and KNIME and others and I'm getting into PAD just now and I truly appreciate the help and support.  Thank you!!

Anonymous
Not applicable

I have all the Chrome instances closed and am still getting this error.  I'll try it on another machine if that makes a difference.  

 

 

Robin.Core.ActionException: Failed to assume control of Chrome (Internal error or communication failure). ---> System.NullReferenceException: Object reference not set to an instance of an object.
at Robin.Shared.Runtime.WebUtilities.ChromeLauncher.CreateWebBrowser(IntPtr handle, TabInfo tab)
at Robin.Shared.Runtime.WebUtilities.WebExtensionsBrowserLauncher.LaunchNew(ProcessWindowStyle processWindowStyle, String initialUrl)
at Robin.Shared.Runtime.WebUtilities.Chrome.TryStartNew(ProcessWindowStyle processWindowStyle, String initialUrl)
at Robin.Modules.WebAutomation.Actions.WebAutomationActions.LaunchNewChrome(Variant initialUrl, Variant chromeTabTitle, Variant chromeTabUrl, Variant dialogButtonToPress, Variant& webBrowserInstance, Int32 operation, Int32 windowState, Int32 attachMode, Boolean waitForWebPageToLoad, Int32 courseOfActionIfDialogAppears, Boolean clearCache, Boolean clearCookies)
--- End of inner exception stack trace ---
at Robin.Modules.WebAutomation.Actions.LaunchChromeBase.Execute(ActionContext context)
at Robin.Runtime.Engine.ActionRunner.RunAction(String action, Dictionary`2 inputArguments, Dictionary`2 outputArguments, IActionStatement statement)

 

t5p_0-1617467509086.png

 

@fraenK, with all respect, speaking from my 5+ years working with RPA, you are flat out wrong.

A. The scripting involved is not "3rd party." It's actions built into PAD. Powershell is Microsoft. IronPython is Microsoft. VBScript is Microsoft. Javascript is of course not MS but it's everywhere.

B. I fail to see how using simple JS on a web page is more complex than the convoluted editing of selectors.

C. You say "[s]cripting support is there to reuse existing scripts, when you migrate from earlier solutions or if there is something you can't handle with the built-in functionality/without scripting." If you can supply some authority for this, it would be helpful. In fact, on almost all platforms (e.g. UiPath, Automation Anywhere, Intellibot, Blue Prism, openrpa, ElectroNeek, G1ANT) you had better be prepared to do some scripting or you'll never get hired, if that's your goal.

 

The problem to be dealt with here is at least multiple.

1) The particular target page has active anti-automation measures. Try banging it long enough and you'll hit a captcha. This also means if you're trying to automate it (rotating proxy considerations aside) you had better be prepared to maintain it, because the page IS GOING TO CHANGE.

2) Sometimes UI Automation works (especially with Chrome, as here, with its "Chrome Legacy Window") even when it shouldn't. This UI Automation works reliably (so far, although it is certain to crash and burn for the reasons stated above and is unlikely to work in other browsers). Web Automation for this is a poor substitute for either JS or UI Automation for this particular case.

ui-weirdness.png

 

 

@Anonymous, I think I have misled you here, my apologies. I would try just launching a new Chrome instance, as you're going to be navigation to new URLs for each iteration of the loop, right? But that shouldn't stop it from working, I don't think. The error about not being able to communicate with Chrome is a head-scratcher. That said, if Chrome fails to shut down correctly I sometimes find orphaned instances of it still running in Task Manager. Would you mind checking to see if there are any such instances still running? You might also restarting (I know, I hate it when people tell me that, especially when I call call up Comcast for technical support 😀).

 

Anonymous
Not applicable

Thank you @burque505 .  I am googling to look for information.  Meantime, I tried Edge and it works with your JavaScript and can loop thru fine except that it's downloading the geoMap.csv files.  It's a progress!!

 

t5p_1-1617469808900.png

 

 

Anonymous
Not applicable

I tried the same workflow in another Windows machine and I am getting that same error.  I may stick with Edge since it worked now, just need to download the right file but it would actually be good if I can download these different files from the page.  I have to step away but thank you so much!!!!

Hi, @Anonymous, I've noticed that too (geoMap.csv, I mean). What is the name of the file you're wanting? If I use the UI Automation flow I posted earlier it downloads multiTimeline.csv. This is an interesting situation! Fun (well for me at least 😀).

 

As @fraenK quite rightly pointed out earlier, there are multiple potential download buttons. I know you're not going to be back to the forum for a while, but I'm going to to experiment with the different buttons (JS - sorry @fraenK 😀) to see if I can get a reliable, repeatable unique file name.

Anonymous
Not applicable

This is the file I was originally attempting to download multiTimeline.csv, but it's interesting that now the script is downloading the map too.  🙂  Added benefit!!!

@burque505 Nope, worked for and with most of the leading vendors you've mentioned in/with their largest projects and customers.

 

A. "3rd party" was more about the technology, additional scripting environments bring additional knowledge, development, infrastructure, testing and maintenance requirements as well as their own problems. Because you mentioned it:

  • PowerShell is not executed by PAD, but by Windows' PowerShell environment = dependency
  • IronPython support is based on an older, just bundled DLL, which is not directly developed by Microsoft but an Open Source community. It "_aims_ to be a fully compatible implementation of the Python language". The PAD documentation is not very transparent about that, which other users already led to a full blown Python environment assumption
  • VBScript is not executed by PAD as well, but by the Windows Scripting Host = dependency
  • JavaScript (browser) is not executed by PAD as well, but by the chosen browser and we all know how standardized JavaScript support is... = dependency
  • JavaScript (Windows) is not really JavaScript but Microsoft's JScript, which is a dialect and executed by Windows' Scripting Host (PAD documentation is not very transparent about that, which other users already led to a full blown JavaScript support assumption) = dependency

B. PAD is meant as a low code environment. You go to the selector builder and deselect unnecessary attributes and select necessary ones. Just a few clicks, no code and JS knowledge required, no additional dependencies. Why replacing an easy-to-use and working built-in functionality with additional code? 

 

C. RPA vendors added scripting support because customers requested it, because they wanted to reuse scripts or were skilled in those languages. And there were/are requirements which you can't meet with the built-in functionality. I was and am managing those discussions between customers and R&D. It's of cause always good to have some scripting skills, but for automation on scale, it's technical debt, which means additional maintenance efforts.


--
Was this helpful? Then give it a thumbs up and/or select it as the solution!

Just use this code, it works fine in every browser, 30seconds to create:

WebAutomation.AttachToEdgeByUrl TabUrl: $'''https://trends.google.com/trends/explore?''' BrowserInstance=> Browser
WebAutomation.FormFilling.PressButton BrowserInstance: Browser Control: appmask['Web Page \'Google Trends\'']['1st CSV download button']

Add a UI element by clicking on the download button and strip down the selector in the selector builder down to the code, or switch to custom selector and paste the code:

button[Class="widget-actions-item export"]:eq(0)  

 


--
Was this helpful? Then give it a thumbs up and/or select it as the solution!

 

WebAutomation.AttachToEdgeByUrl TabUrl: $'''https://trends.google.com/trends/explore?''' BrowserInstance=> Browser

 

That won't work in every browser (that's for Edge only), and the URL should be

https://trends.google.com/trends/explore?date=2020-01-01 2020-12-31,2019-01-01 2019-12-31,2018-01-01 2018-12-31&geo=US,US,US&q=how to cook ramps,how to cook ramps,how to cook ramps

Also,

 

WebAutomation.FormFilling.PressButton BrowserInstance: Browser Control: appmask['Web Page \'Google Trends\'']['1st CSV download button']

 

will require the creation of an appmask first, and will definitely crash for anybody (at least using the free version, I think) who pastes that code in. Also, there is no form there, so Robin's placement of this action

 

WebAutomation.FormFilling.PressButton

 

in the subcategory it's in is sure to generate confusion.

 

The selector you supply

 

button[Class="widget-actions-item export"]:eq(0)  

 

doesn't work for me in Edge.

Helpful resources

Announcements

Community will be READ ONLY July 16th, 5p PDT -July 22nd

Dear Community Members,   We'd like to let you know of an upcoming change to the community platform: starting July 16th, the platform will transition to a READ ONLY mode until July 22nd.   During this period, members will not be able to Kudo, Comment, or Reply to any posts.   On July 22nd, please be on the lookout for a message sent to the email address registered on your community profile. This email is crucial as it will contain your unique code and link to register for the new platform encompassing all of the communities.   What to Expect in the New Community: A more unified experience where all products, including Power Apps, Power Automate, Copilot Studio, and Power Pages, will be accessible from one community.Community Blogs that you can syndicate and link to for automatic updates. We appreciate your understanding and cooperation during this transition. Stay tuned for the exciting new features and a seamless community experience ahead!

Summer of Solutions | Week 4 Results | Winners will be posted on July 24th

We are excited to announce the Summer of Solutions Challenge!    This challenge is kicking off on Monday, June 17th and will run for (4) weeks.  The challenge is open to all Power Platform (Power Apps, Power Automate, Copilot Studio & Power Pages) community members. We invite you to participate in a quest to provide solutions to as many questions as you can. Answers can be provided in all the communities.    Entry Period: This Challenge will consist of four weekly Entry Periods as follows (each an “Entry Period”)   - 12:00 a.m. PT on June 17, 2024 – 11:59 p.m. PT on June 23, 2024 - 12:00 a.m. PT on June 24, 2024 – 11:59 p.m. PT on June 30, 2024 - 12:00 a.m. PT on July 1, 2024 – 11:59 p.m. PT on July 7, 2024 - 12:00 a.m. PT on July 8, 2024 – 11:59 p.m. PT on July 14, 2024   Entries will be eligible for the Entry Period in which they are received and will not carryover to subsequent weekly entry periods.  You must enter into each weekly Entry Period separately.   How to Enter: We invite you to participate in a quest to provide "Accepted Solutions" to as many questions as you can. Answers can be provided in all the communities. Users must provide a solution which can be an “Accepted Solution” in the Forums in all of the communities and there are no limits to the number of “Accepted Solutions” that a member can provide for entries in this challenge, but each entry must be substantially unique and different.    Winner Selection and Prizes: At the end of each week, we will list the top ten (10) Community users which will consist of: 5 Community Members & 5 Super Users and they will advance to the final drawing. We will post each week in the News & Announcements the top 10 Solution providers.  At the end of the challenge, we will add all of the top 10 weekly names and enter them into a random drawing.  Then we will randomly select ten (10) winners (5 Community Members & 5 Super Users) from among all eligible entrants received across all weekly Entry Periods to receive the prize listed below. If a winner declines, we will draw again at random for the next winner.  A user will only be able to win once overall. If they are drawn multiple times, another user will be drawn at random.  Individuals will be contacted before the announcement with the opportunity to claim or deny the prize.  Once all of the winners have been notified, we will post in the News & Announcements of each community with the list of winners.   Each winner will receive one (1) Pass to the Power Platform Conference in Las Vegas, Sep. 18-20, 2024 ($1800 value). NOTE: Prize is for conference attendance only and any other costs such as airfare, lodging, transportation, and food are the sole responsibility of the winner. Tickets are not transferable to any other party or to next year’s event.   ** PLEASE SEE THE ATTACHED RULES for this CHALLENGE**   Week 1 Results: Congratulations to the Week 1 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge.   Community MembersNumber SolutionsSuper UsersNumber Solutions Deenuji 9 @NathanAlvares24  17 @Anil_g  7 @ManishSolanki  13 @eetuRobo  5 @David_MA  10 @VishnuReddy1997  5 @SpongYe  9JhonatanOB19932 (tie) @Nived_Nambiar  8 @maltie  2 (tie)   @PA-Noob  2 (tie)   @LukeMcG  2 (tie)   @tgut03  2 (tie)       Week 2 Results: Congratulations to the Week 2 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 2: Community MembersSolutionsSuper UsersSolutionsPower Automate  @Deenuji  12@ManishSolanki 19 @Anil_g  10 @NathanAlvares24  17 @VishnuReddy1997  6 @Expiscornovus  10 @Tjan  5 @Nived_Nambiar  10 @eetuRobo  3 @SudeepGhatakNZ 8     Week 3 Results: Congratulations to the Week 3 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 3:Community MembersSolutionsSuper UsersSolutionsPower Automate Deenuji32ManishSolanki55VishnuReddy199724NathanAlvares2444Anil_g22SudeepGhatakNZ40eetuRobo18Nived_Nambiar28Tjan8David_MA22   Week 4 Results: Congratulations to the Week 4 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 4:Community MembersSolutionsSuper UsersSolutionsPower Automate Deenuji11FLMike31Sayan11ManishSolanki16VishnuReddy199710creativeopinion14Akshansh-Sharma3SudeepGhatakNZ7claudiovc2CFernandes5 misc2Nived_Nambiar5 Usernametwice232rzaneti5 eetuRobo2   Anil_g2   SharonS2  

Check Out | 2024 Release Wave 2 Plans for Microsoft Dynamics 365 and Microsoft Power Platform

On July 16, 2024, we published the 2024 release wave 2 plans for Microsoft Dynamics 365 and Microsoft Power Platform. These plans are a compilation of the new capabilities planned to be released between October 2024 to March 2025. This release introduces a wealth of new features designed to enhance customer understanding and improve overall user experience, showcasing our dedication to driving digital transformation for our customers and partners.    The upcoming wave is centered around utilizing advanced AI and Microsoft Copilot technologies to enhance user productivity and streamline operations across diverse business applications. These enhancements include intelligent automation, AI-powered insights, and immersive user experiences that are designed to break down barriers between data, insights, and individuals. Watch a summary of the release highlights.    Discover the latest features that empower organizations to operate more efficiently and adaptively. From AI-driven sales insights and customer service enhancements to predictive analytics in supply chain management and autonomous financial processes, the new capabilities enable businesses to proactively address challenges and capitalize on opportunities.    

Updates to Transitions in the Power Platform Communities

We're embarking on a journey to enhance your experience by transitioning to a new community platform. Our team has been diligently working to create a fresh community site, leveraging the very Dynamics 365 and Power Platform tools our community advocates for.  We started this journey with transitioning Copilot Studio forums and blogs in June. The move marks the beginning of a new chapter, and we're eager for you to be a part of it. The rest of the Power Platform product sites will be moving over this summer.   Stay tuned for more updates as we get closer to the launch. We can't wait to welcome you to our new community space, designed with you in mind. Let's connect, learn, and grow together.   Here's to new beginnings and endless possibilities!   If you have any questions, observations or concerns throughout this process please go to https://aka.ms/PPCommSupport.   To stay up to date on the latest details of this migration and other important Community updates subscribe to our News and Announcements forums: Copilot Studio, Power Apps, Power Automate, Power Pages

Users online (517)