0
votes

I have a CSV file of companies where I want to add in a column "CEO Name". I'm trying to build a UiPath process as follows:

  • Read from CSV File
  • Search Google for "company" + the words "CEO LinkedIn"
  • Pull their LinkedIn name or profile URL
  • Copy into an Excel spreadsheet

I have tried to do this, but when I run it the search doesn't copy and Paste. I'm using UiPath Studio.

3
Please share some more insights - images, code, and which activities you used (example: I used Set Text activities.uipath.com/docs/set-value, but it wouldn't copy the value to my search window). Also, make sure the browser extensions are installed if you're on Chrome or Firefox. - Wolfgang Radl

3 Answers

0
votes

This should be very straightforward with UiPath and it's well covered within foundation course at UiPath Academy. Read from CSV into a datatable, go through each row with For Each Row cycle, use Browser Scope to work with the browser of your choice and Type Into, Click and Get Text to get results from Google. Then just add information to the same or a new datatable and use Write Range to write to Excel. All in all 10 minutes work

0
votes

So this is how I do it.

  1. define a variable with the type of array row.
  2. Use the Build Data-Table with all the columns you want.
  3. Read CSV with an output to a a data-table.
  4. do your search and get your variable you want assigned from inside of a for each loop.
  5. assign you array row (Lets assume your for each loop is using the name rowToUse) This would look like 'arrayRow = {rowToUse(1).tostring, rowToUse(2).tostring, Etc, Etc, LinkedIn}
  6. Once you have your arrayRow built then use a the Add data row activity building to your new blank Data Table. Your loop with iterate through all the datatable rows and build your new datatable. You can then write it to a new CSV.

Hope this made sense!

-3
votes

I'd use Python, AppRobotic, and Selenium together. You'd have tight integration with Excel/CSV and anything else on Windows by leveraging Python and AppRobotic, and then import 'webbrowser' in Python, or just launch a browser with AppRobotic or Selenium.

Here's a quick example without Selenium, but adding it in and searching for textfields/buttons/etc by XPath/ID/Name identifiers would make your automation even more reliable:

import win32com.client
x = win32com.client.Dispatch("AppRobotic.API")
import webbrowser

myExcel = win32com.client.Dispatch('Excel.Application')
myExcel.Visible=True

# path to Excel file
myWorkbook = myExcel.Workbooks.Open('C:\\Users\\myUser\\Desktop\\companies.xlsx',ReadOnly=True)
# specify Excel sheet name
myWorksheet = myWorkbook.Sheets('Sheet1')
# count rows
myRange = str(myWorksheet.UsedRange.Rows.Count)
myData = myExcel.Range("A1:A"+myRange)
# loop through rows, print the result to Log Printout, and perform macro steps
for companyName in myData:
    if companyName is not None:
        # convert company name to string
        companyName = str(companyName)
        # keep track of company names in Log Printout app
        x.Print(companyName)

        # open with default browser
        webbrowser.open_new('https://www.google.com') 

        # wait a bit for page to open
        x.Wait(3000)
        # use UI Item Explorer to get X,Y coordinates of Search box
        x.MoveCursor(438, 435)
        # click inside Search box
        x.MouseLeftClick

        # parameterize this with a cell value from Excel/CSV file
        # x.Type("AppRobotic CEO Linkedin")
        x.Type(companyName + " CEO Linkedin")

        x.Type("{ENTER}")