
Hi!
I noticed that this question was already asked a couple of times but I couldn't find a proper solution.
In my flow I search for a specific term in Google Search and then I extract data from the Search site (URL anchored to the "Website" button of Google Pin to be precise). To achieve that, I use the "Extract data from webpage" option, where I specify the CSS selector and the attribute.
It seems like the process of extraction works perfectly fine - in the "Live web helper" window I see that the exact URL I need is extracted. I get an error anyways, it says "Failed to extract data (web page error while extracting data)". I tried adding a wait time after performing the search action, as well as waiting for the webpage element.
What could be the solution for this issue? It's really confusing for me, I see that the sole extraction process works fine, but then an error pops up anyways... Can it be some kind of an error while saving the URL as a variable?
Alex
Automating the web UI of Google search is not exactly a great way of doing this. The page changes frequently in ways that may not be visible to the human eye, but can easily break the flow.
Instead, try using the Google Custom Search JSON API. It can be used quite easily and a free Google account allows running up to 100 queries every 24 hours. If you need more, you can rotate several accounts, or get a paid capacity increase.
See the documentation here: https://developers.google.com/custom-search/v1/overview
We have in fact implemented this in the past and it works much more reliably than any UI automation.
Alternatively, if you don't want to go the API way, I would suggest using the Get details of web page action to get the page source and then using Parse text with regular expressions to retrieve the values you need. This will likely also be more stable than the UI actions.
-------------------------------------------------------------------------
If I have answered your question, please mark it as the preferred solution. If you like my response, please give it a Thumbs Up.
I also provide paid consultancy and development services using Power Automate. If you're interested, DM me and we can discuss it.