Pasting out DataTable to excel problems

Hello guys, so I’m building a simple example of an SEO tool to find out if my keyword’s are in the top10 search results, but I’m having some problems with pasting out the info correctly.
The robot would work like that - Reads and excel file, which has all the keywords I need to check, for each row in Data Table takes them, puts them in google search, takes all the results from the first page and pastes it out to excel. It would take the H1 title, URL and thats it.
A few questions:
1. So for the H1 title and URL I am using extract table data (it works very well). But I cant use it on the keyword that the search was done (check the first photo), so for that I use get text activity. But now heres the problem. Is it possible for me to add that Get Text variable to the DataTable from “Extract Table Data”? I tried to Add Data Column, but the value of the Get Text activity doesnt paste out in the needed column.
2. The project has an For each row in data table activity which loops through excel Keyword list and takes info from google. Is it possible, that when I use write range, it would leave a row blank? For example: Screenshot by Lightshot

why u need to validate that keyowrd??

Its for my co-workers. So it would be easier to know what keyword has those reasults.

Hi @Povilas_Jonikas

  1. You do not need to get text for the key word because you are already having it in the variable for you , because you did input the data in search bar.
  2. Before pasting the datatable to excel add a blank row using add data row so that a blank row is added. Or while pasting the data count the number of rows and paste the next table leaving one row by incrementing the count by 1

Hope this is what you are trying to do. If not happy to help

cheers

1 Like

Thanks Anil for you’r response.

Ok, but how do I write the taken keyword down to excel with the results that I get from it?
I wish I could do something to get an output like that: Screenshot by Lightshot

Hi @Povilas_Jonikas

Before writing the data that is before using write range use a write cell activity and write the key word and then use write range to write your table from the next row

Your sequence looks like below


For loop on Keyword
   Search and extract
   write cell for keyword
   Add data row to the extracted table with empty data
   write range for extracted data

cheers

1 Like

Thanks again Anil, but I’m still having problems implementing your steps into my project. Ill attach the project that im working on here, maybe you could help me by taking a look at how it’s shaped and then let me know what you think? Thanks a lot! :slight_smile:
Pozicijos.7z (344.1 KB)

Ok, I made progress, but one thing is left and it wont work. I can’t figure out how to make the “write cell” write the keyword next to the newly extracted data. I Tried looking up what should I put in the “Cell” window, but cant figure that out.

Hi @Povilas_Jonikas

For that you have to maintain a count variable to know how many rows are filled. This can be done by counting the number of rows in the datatable and add them to the count in the for loop

count = count + dt.RowCount

And whatever you are searching in the search window is the same variable you need to pass here as well

And sorry I dint take a look at your xaml yet. If you can upload as a zip file that would be great

cheers

1 Like

Thanks Anil again

Ill try in a bit with the count part in a hurry.

I’ve attatched it right here
Pozicijos.7z (344.1 KB)

Hi @Povilas_Jonikas

try this

This is how it looks

Added 3 to count because 1 row for balnk,1 row for header, 1 row for heading of keyword

projectforloop.xaml (20.9 KB)

cheers

@Povilas_Jonikas

Did it help?

It did work and sorry for the late response. Thanks a lot :slight_smile:

1 Like

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