Change ATTR TXT to data CSV

Support for iMacros. The iMacros software is the unique solution for automating every activity inside a web browser, for data extraction and web testing.

Moderators: Community Moderators, iMacros Moderators

Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the Google search box (at the top of each forum page) to see if a similar problem or question has already been addressed. This will search the entire contents of the forums as well as the iMacros Wiki.
3. We can respond much faster to your posts if you include the following information:

CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST

Answering your own posts (e.g. attempting to "bump" your topic) drops your topic from the list of unanswered threads, so it may actually receive less views.

Re: Change ATTR TXT to data CSV

by Louise17 on Wed Aug 09, 2017 10:43 pm

up
Louise17
 
Posts: 6
Joined: Thu Aug 03, 2017 1:25 am

Re: Change ATTR TXT to data CSV

by chivracq on Thu Aug 10, 2017 3:08 am

Louise17 wrote:i am just recording the macros using imacros and would be converting it to VBscripting. I have my VB code on the excel file itself where the variable for country (Singapore) is located.

btw, i have recorded a new set of imacros while changing the selecting on the drop down field of the website. it looks like this
Code: Select all
TAG POS=2 TYPE=LI ATTR=TXT:American<SP>Samoa
TAG POS=1 TYPE=UL ATTR=ID:q9427-list
TAG POS=1 TYPE=INPUT:TEXT ATTR=ID:q9427-edit CONTENT=Åland<SP>Islands
TAG POS=2 TYPE=LI ATTR=TXT:Select
TAG POS=1 TYPE=LI ATTR=TXT:Afghanistan


I have coded my vbs like this:
Code: Select all
  macro = macro + "TAG POS=1 TYPE=UL ATTR=ID:q9427-list CONTENT={{cob}}" + vbNewLine
  macro = macro + "TAG POS=2 TYPE=LI ATTR=TXT:{{cob}}" + vbNewLine


the value {{cob}} is taken from the condition below (still on the excel file).

Code: Select all
iret = iim1.iimSet("COUNTRY_OF_BIRTH", Cells(row, 8).Value)
Sheetname = "Map_Country"
FromValue = Cells(row, 8).Value
cob = Mapping(Sheetname, FromValue)
iret = iim1.iimSet("C_O_B", cob)
MsgBox cob


while mapping is:
Code: Select all
Public Function Mapping(Sheetname, FromValue) As String
    Dim ToValue As String
   
    'MsgBox "Sheet name is " + Sheetname
    'MsgBox "FromValue is " + FromValue
    Sheets(Sheetname).Select
    Columns("A:A").Select
    Selection.Find(What:=FromValue, After:=ActiveCell, LookIn:=xlFormulas, _
        LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
        MatchCase:=False, SearchFormat:=False).Activate
    'Range("B2").Select
    ToValue = ActiveCell.Offset(, 1).Value
    'MsgBox ActiveCell.Offset(, 1).Value
    Mapping = ToValue


End Function

Louise17 wrote:my bad the {{cob}} is actually a {{C_O_B}}

Louise17 wrote:up

Euh..., yep, but what is the Pb now...? I don't use/know VB Scripting even if I can follow an iMacros '.vbs' Script but you are using a different Mechanism/Syntax...
Use 'PROMPT' / 'alert()' or the Equivalent in VB to follow your Vars and debug your Script... Oh...!, that's probably your 'MsgBox'...

You don't use the iMacros '!DATASOURCE' + '!COLn' Mechanism I mentioned to retrieve your 'Country' Value...

(You have a Setting btw when posting a Reply on the Forum to disable Smileys which seems to interfere a bit with your Vb Syntax...)
- (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...
chivracq
 
Posts: 6490
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Previous

Return to General Support & Discussions

Who is online

Users browsing this forum: Google [Bot] and 6 guests

-->