Skip to main content

Notifications

Community site session details

Community site session details

Session Id : DRghkZtJLoJBf4Yh6z+oPC
Power Automate - Power Automate Desktop
Suggested answer

Extract link from Google Search Results Page

Like (1) ShareShare
ReportReport
Posted on 22 Jan 2025 16:49:38 by 44
Hi Community, 
 
I am having trouble extracting links from 3 first results on Google Search. 
 
Example below: 
 
 
I have already tryed GET DETAILS FROM WEB PAGE (HREF) or EXTRACT DATA FROM WEBPAGE, but each new result from a search list (for example: "basketball list of teams", "football UK teams", "football Spain teams") it doesn't go through. 
So this will be an iteraction and after I am write in a spreedsheet. 
 
How can I extract data without specifying an IU Element. 
 
Thanks in advance!
Categories:
  • hello11 Profile Picture
    44 on 23 Jan 2025 at 14:22:30
    Extract link from Google Search Results Page
     
    Thank you for the reply. 
    Your suggestion does not attend my problem. 
    How can I extract full url with UI Element (Href) from Google Search Results? 
     
    Thanks!
     
  • Suggested answer
    Deenuji_Loganathan_ Profile Picture
    6,105 Super User 2025 Season 1 on 23 Jan 2025 at 04:58:29
    Extract link from Google Search Results Page
    Hi There,
     
    You may consider the below approach to achieve your goal.
    Only you need little bit cleansing work before you merge your scrapped data into master table. Please take of that part.
     
     
     
     
    Code(Copy and paste the below code and paste into your power automate desktop app but please note recapture the populate text and press button element):
     
    Variables.CreateNewList List=> List
    Variables.AddItemToList Item: $'''basketball list of teams''' List: List
    Variables.AddItemToList Item: $'''football UK teams''' List: List
    Variables.AddItemToList Item: $'''football Spain teams''' List: List
    WebAutomation.LaunchEdge.LaunchEdge Url: $'''www.google.com''' WindowState: WebAutomation.BrowserWindowState.Maximized ClearCache: False ClearCookies: False WaitForPageToLoadTimeout: 60 Timeout: 60 PiPUserDataFolderMode: WebAutomation.PiPUserDataFolderModeEnum.AutomaticProfile TargetDesktop: $'''{\"DisplayName\":\"Local computer\",\"Route\":{\"ServerType\":\"Local\",\"ServerAddress\":\"\"},\"DesktopType\":\"local\"}''' BrowserInstance=> Browser
    Variables.CreateNewDatatable InputTable: { ^[] } DataTable=> MasterTable
    LOOP FOREACH CurrentItem IN List
        WebAutomation.PopulateTextField.PopulateTextFieldUsePhysicalKeyboard BrowserInstance: Browser Control: appmask['Web Page \'https://www.google.com/\'']['Text area \'Search\''] Text: CurrentItem Mode: WebAutomation.PopulateTextMode.Replace UnfocusAfterPopulate: True WaitForPageToLoadTimeout: 60
        WebAutomation.PressButton.PressButton BrowserInstance: Browser Control: appmask['Web Page \'https://www.google.com/\'']['Input submit \'Google Search\''] WaitForPageToLoadTimeout: 60
        WebAutomation.ExtractData.ExtractTable BrowserInstance: Browser Control: $'''html > body > div:eq(2) > div > div:eq(12) > div > div:eq(0) > div:eq(1) > div:eq(1) > div > div > div''' ExtractionParameters: {[$'''div > div > div > div:eq(0) > div > div > span > a''', $'''Href''', $'''''', $'''Value #1'''], [$'''div > div > div:eq(0) > div > div > span > a''', $'''Href''', $'''''', $'''Value #2'''] } PostProcessData: False TimeoutInSeconds: 60 ExtractedData=> DataFromWebPage
        Variables.MergeDataTables FirstDataTable: MasterTable SecondDataTable: DataFromWebPage MergeMode: Variables.MergeMode.AddExtraColumns
        WebAutomation.GoToWebPage.GoToWebPage BrowserInstance: Browser Url: $'''www.google.com''' WaitForPageToLoadTimeout: 60
    END
     

    Description

    Thanks,
    Deenuji Loganathan 👩‍💻
    Power Automate Desktop Community Champion 🤖
    ------------------------------------------------------------------------------------------------------------
    If I've helped solve your query, kindly mark my response as the solution for this topic ✔ and like my suggestion ❤️ Your feedback supports future seekers 🚀

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,743 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,089 Most Valuable Professional

Leaderboard
Loading started