Get data and copy from chrome to excel

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
paulrf
Newbie
Posts: 2
Joined: Fri Oct 22, 2021 6:17 am

Get data and copy from chrome to excel

Post by paulrf » Sat Oct 23, 2021 1:56 am

Hello
I bought your Macro Scheduler pro but i have problem , i am doing a macro with chrome and i have a bunch of questions can you guys answer me .
1. how to open a file automatically after download (excel file, downloaded after using "ChromeFindElements" and click to download on chrome ?
2. how after opening excel file can resize program excel
3 how to move to a cell in the opened excel file and copy the data from that cell to another excel file.
4. how i can get data from chrome and copy to excel , i try ChromeGetElementData but don't go , i want to get only 1 404,39

code :
<td class="row0" style="text-align:right;"><span style="white-space: nowrap;">1 404,39 zł</span></td>

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1389
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Re: Get data and copy from chrome to excel

Post by Dorian (MJT support) » Mon Oct 25, 2021 10:54 am

paulrf wrote:
Sat Oct 23, 2021 1:56 am
1. how to open a file automatically after download (excel file)
Wait for the file to download (or loop IfFileExists), Use XLOpen to open the Excel file


paulrf wrote:
Sat Oct 23, 2021 1:56 am
2. how after opening excel file can resize program excel
Resize the window? ResizeWindow and if required MoveWindow


paulrf wrote:
Sat Oct 23, 2021 1:56 am
3 how to move to a cell in the opened excel file and copy the data from that cell to another excel file.
you've already used XLOpen to open the first Excel file, so then use XLGetCell to read the data from the cell you require. Then use XLOpen to open the second file, and XLSetCell to write to the required cell in the newly opened Excel workbook. Make sure to use a different handle for each workbook opened with XLOpen (reading the pages I linked to will explain that).


paulrf wrote:
Sat Oct 23, 2021 1:56 am
4. how i can get data from chrome and copy to excel , i try ChromeGetElementData but don't go , i want to get only 1 404,39
el_1 will be the first match, el_2 the second, el_3 the third, and so on. There may be a better way of doing this but this example specifically relates to the snippet you provided.

Code: Select all

ChromeFindElements>session_id,xpath,//span[@style='white-space: nowrap;'],el
ChromeGetElementData>session_id,el_1,text,TheText
mdl>TheText
Then write TheText to your spreadsheet with XLSetCell.
Yes, we have a Custom Scripting Service. Message me or go here

paulrf
Newbie
Posts: 2
Joined: Fri Oct 22, 2021 6:17 am

Re: Get data and copy from chrome to excel

Post by paulrf » Fri Oct 29, 2021 4:20 pm

Thank you for the answer , can you help me in this case .
There are 1 billion
I have 1 column of data in excel, for example: column A from A1 to A10 contains data that I have to replace the website link, A1 = 123455 access the link of the website abc.com/12345.pdf and download the pdf file Then repeat the process until you find an empty box

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1389
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Re: Get data and copy from chrome to excel

Post by Dorian (MJT support) » Fri Oct 29, 2021 6:01 pm

First of all you'd use XLGetSheetDims to find out how many rows there are, and loop that many times.

You should then be able to download the pdf with HTTPRequest :

Code: Select all

let>TheURL=https://www.mjtnet.com/MacroSchedulerManual.pdf
HTTPRequest>TheURL,d:\MacroSchedulerManual.pdf,GET,,HTMLResponse
Yes, we have a Custom Scripting Service. Message me or go here

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts