I just created my first macro and it seems doing a little bit too much. I need to automate the following task: copy a cell from a csv file, paste it to google.com/finances search area, get search result, scroll down, copy industry and sector and paste this info to the csv file. My issue is that my macro seems copying everything from the web page and I get industry and sector just on the line 498 of my csv file.
And I have a couple more questions: how could I avoid it throws me an error if google doesn't find anything, or it runs into an empty cell on my csv file?
I will really appreciate your help.
My macros is bellow:
Code: Select all
VERSION BUILD=11.5.498.2403
TAB T=1
TAB CLOSEALLOTHERS
SET !PLAYBACKDELAY 0.2
SET !DATASOURCE "C:\\Users\\Agne\\Desktop\\bandymas\\kitas_failas.csv"
SET !LOOP 1
SET !DATASOURCE_LINE {{!LOOP}}
URL GOTO=google.com/finance
TAG POS=1 TYPE=INPUT:TEXT ATTR=NAME:q CONTENT={{!COL1}}
TAG POS=1 TYPE=BUTTON:SUBMIT ATTR=ID:gbqfb
TAG POS=10 TYPE=DIV ATTR=CLASS:g-unit<SP>g-first EXTRACT=TXT
SAVEAS TYPE=TXT FOLDER= C:\\Users\\Agne\\Documents\\imacros FILE=naujas.csv