7.RPA Challenge - Scrape Cmd Line


#1

Open a cmd.
Type ipconfig /all + [Enter] two times.
I want to retrieve all the text within the cmd window and save it in a notepad.

The idea came from here: Screen scrape of hidden text


Automation Challenge Winners
Citrix Automation - Need to scrap data from Commad prompt
Text scrapping
CMD Content in Variable
#2

My suggestions.

  1. Use mouse RIGHT CLICK option,
  2. Use SEND HOT KEY activity with Key DOWN in order to choose SELECT ALL option from the menu,
  3. Use SEND HOT KEY activity with Key ENTER (it copies all text to clipboard),
  4. Use Get from clipboard activity to get all the copied text to a string variable,
  5. Finally we can write the text from a variable to notepad.

Thanks,
Siva.


#3

Can’t send the code right now, but simple trick is:


#4

Here’s my solution

RPA_Challenge_7.xaml (12.1 KB)

I have done with the “manually” process.

Regards,


#5

Hi @badita

My solution
ScrapeCmd.xaml (11.8 KB)

Regards


#6

I’m getting an error on Click cmd.exe... due to the selector:

<wnd app='conhost.exe' cls='#32768' />
<ctrl name='Context' role='popup menu' />
<ctrl automationid='65525' />

which is not recognized.

I also don’t why the previous Click does not have a selector. Target is empty.


#7

It’s @tomek.pawlicki !!

Tomorrow 1 PM GMT I’ll post one I am not able to solve myself :slight_smile:


#8

This :point_up_2:

Scrape Cmd Line.zip (351.2 KB)


#9

Just adding my solution to the list.

I found that some of the activities were not generating selectors (close application for instance when I clicked on notepad and others and some activities generate selectors that don’t function properly) so I use Ui Explorer to generate all selectors, or at least so that I can compare the selector created by Ui Explorer to the one created by the activity.

Main.xaml (20.7 KB)