Loop inputs through csv while scrapping

Discussions and Tech Support related to website data extraction, screen scraping and data mining using iMacros.
Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information:CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
Post Reply
gepres
Posts: 3
Joined: Wed Dec 05, 2018 8:56 pm

Loop inputs through csv while scrapping

Post by gepres » Fri Dec 07, 2018 10:23 pm

Hey everyone. My code is below. What I am trying to do is loop the inputs the contents of cells in my csv file in --> "client CONTENT=cell contents " (4th line from the bottom). So, my csv has a bunch of client codes, and I am trying to get the macro to log in to my account, get the client code from the csv file, input it in the box, go to the page and extract a certain line. After that, i want it to go back to main page, go to the next line in the csv file (so second client) and input the second code. Keep doing this until the csv has no more lines. My current code stops after the first input from the csv file.

I am using the iMacros Browser and there is no loop options. I attached a picture of what the display is.

Does anyone know how I can do this? Thank you in advance!



VERSION BUILD=12.5.503.8802
TAB T=1
TAB CLOSEALLOTHERS

SET !EXTRACT_TEST_POPUP
SET !DATASOURCE """"name of my file"""".csv
SET !LOOP 2
SET !DATASOURCE_LINE {{!LOOP}}
WAIT SECONDS=0.5
URL GOTO = https://www. of the website (can't show the real one)"""
WAIT SECONDS=0.5
TAG POS=1 TYPE=A ATTR=TXT:"login"
TAG POS=1 TYPE=INPUT:TEXT ATTR=NAME:USERID CONTENT=""""my username""""
SET !ENCRYPTION NO
WAIT SECONDS=0.5
TAG POS=1 TYPE=INPUT:PASSWORD ATTR=NAME:PASSWORD CONTENT=""""my password""""
WAIT SECONDS=0.5
TAG POS=1 TYPE=INPUT:SUBMIT ATTR=NAME:submit
TAG POS=1 TYPE=INPUT:TEXT ATTR=NAME:client CONTENT={{!COL2}}
TAG POS=1 TYPE=INPUT:SUBMIT ATTR=NAME:button.access.bn
TAG POS=3 TYPE=H2 ATTR=* EXTRACT=TXT
BACK
chivracq
Posts: 8523
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Loop inputs through csv while scrapping

Post by chivracq » Sat Dec 08, 2018 12:08 am

gepres wrote:Hey everyone. My code is below. What I am trying to do is loop the inputs the contents of cells in my csv file in --> "client CONTENT=cell contents " (4th line from the bottom). So, my csv has a bunch of client codes, and I am trying to get the macro to log in to my account, get the client code from the csv file, input it in the box, go to the page and extract a certain line. After that, i want it to go back to main page, go to the next line in the csv file (so second client) and input the second code. Keep doing this until the csv has no more lines. My current code stops after the first input from the csv file.

I am using the iMacros Browser and there is no loop options. I attached a picture of what the display is.

Does anyone know how I can do this? Thank you in advance!

Code: Select all

VERSION BUILD=12.5.503.8802
TAB T=1
TAB CLOSEALLOTHERS

SET !EXTRACT_TEST_POPUP
SET !DATASOURCE """"name of my file"""".csv
SET !LOOP 2
SET !DATASOURCE_LINE {{!LOOP}}
WAIT SECONDS=0.5
URL GOTO = https://www. of the website (can't show the real one)"""
WAIT SECONDS=0.5
TAG POS=1 TYPE=A ATTR=TXT:"login"
TAG POS=1 TYPE=INPUT:TEXT ATTR=NAME:USERID CONTENT=""""my username""""
SET !ENCRYPTION NO
WAIT SECONDS=0.5
TAG POS=1 TYPE=INPUT:PASSWORD ATTR=NAME:PASSWORD CONTENT=""""my password""""
WAIT SECONDS=0.5
TAG POS=1 TYPE=INPUT:SUBMIT ATTR=NAME:submit  
TAG POS=1 TYPE=INPUT:TEXT ATTR=NAME:client CONTENT={{!COL2}}
TAG POS=1 TYPE=INPUT:SUBMIT ATTR=NAME:button.access.bn
TAG POS=3 TYPE=H2 ATTR=* EXTRACT=TXT
BACK
:wink:
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
gepres
Posts: 3
Joined: Wed Dec 05, 2018 8:56 pm

Re: Loop inputs through csv while scrapping

Post by gepres » Mon Dec 10, 2018 3:59 pm

Thanks for the reply.

I am using the iMacros browser as mentioned in the initial post. Not the browser version. I have a trial period with the enterprise version.

Thanks!
Post Reply