How to get the text from browser

Hi Team,

How to get a phone number from the screen which is not stable. I have attached few snapshots for reference.




I know it is bit complicated… But i need the phoneNumber from the screen (I have 300 data to get the phoneNumber which is not stable)

Please help me to get the logic :slight_smile:

Thanks,
Rishi

Hi @Putta_Sri_Sai_Rishik_Chow

Try extracting the entire text and store it in a string variable.
Then use regex to extract the phone numbers.

Hello @Putta_Sri_Sai_Rishik_Chow

  1. Use OCR to extract text.
  2. Apply regular expressions to find potential phone number patterns.
  3. Validate and filter matches to ensure accuracy.
  4. Store or use valid phone numbers.

Thanks & Cheers!!!

@Putta_Sri_Sai_Rishik_Chow

-Use the “Open Browser” or “Attach Browser” activity to open the web page you want to extract text from.
you can use the “Data Scraping”

-Drag and drop the “Data Scraping” activity onto your workflow.
-Follow the wizard to select the data you want to extract. You’ll need to indicate the first data element.

-Use the Extracted Text:
After using either “Data Scraping” you’ll have a variable that contains the extracted text. You can store this text in a variable.

Hi @Putta_Sri_Sai_Rishik_Chow,

Find the below pattern for Phone number using Regex:

First scrape data from browser. Assign to a string variable.(yourString)
Then Assign the result to another string variable.

For ex,

MobileVar = System.Text.RegularExpressions.Regex.Match(yourString,“(0-9?)?((?[0-9]{3})?|[0-9]{3})( |-)?([0-9]{3}( |-)?[0-9]{4}|[a-zA-Z0-9]{7})”).ToString

Thanks!

Hi

First extract the entire text and store it in a string variable.
Then use regex to extract the phone numbers.

Thank you

Try to use Get text once you get the value please use regex and don’t indicate the value that you highlight use that value at the top so you can easily extract that.

The regex pattern is not working… Showing error

Have a look

Thanks for your reply

Hi @Putta_Sri_Sai_Rishik_Chow

Don’t copy and paste the expression. Please remove the double quotes from the expression and retype it.

I did the same… but giving issue…!!

Can you please give me the syntax !!

@Putta_Sri_Sai_Rishik_Chow

Can you please provide input samples

1- KSBW 8 NewsPresident & General Manager: Laura Williamson | 831-758-8888 News Director: Cassady Velasco | 831-422-8206 Managing Editor: Joshua Copitch | 831-758-7763REPORT BREAKING NEWS:If you see breaking news or severe weather, send us your photos and videos by emailing them to news@ksbw.com

2- NEAlbuquerque, N.M., 87107Telephone:Main: (505) 884-7777News : (505) 884-6324E-mail tips:If you have news information or a press release you’d like to share with the Action 7 News staff, Click Here

3- You can also call KETV at 402-345-7777 or send mail to:KETV 1001 S.

4- If you have a comment or general question about the station, programming, sales, or editorial, please call our main desk at 412-242-4300

Thanks

@Putta_Sri_Sai_Rishik_Chow

Try this

((\(?\d+\)?\s*\-?\d+\-\d+)(?=\s*(News|or)))|(\d+\-\d+\-\d+$)

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.