Fill the web page content from One Tab to Another Tab by copying specific Texts

Support for iMacros. The iMacros software is the unique solution for automating every activity inside a web browser, for data extraction and web testing.
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
jyotirmaya
Posts: 37
Joined: Wed Jul 27, 2016 6:25 pm

Fill the web page content from One Tab to Another Tab by copying specific Texts

Post by jyotirmaya » Sun Jun 16, 2019 6:23 am

I am using Browser Firefox 48.0
iMacros for Firefox v8.9.7
Windows 7 Professional 64-bit Operating system

I am using the below code.

Code: Select all

VERSION BUILD=8970419 RECORDER=FX
SET !ERRORIGNORE YES

TAB T=1
TAG POS=1 TYPE=TD ATTR=TXT:Village/Ward/Ward:
TAG POS=1 TYPE=TD ATTR=TXT:INDIA
TAG POS=1 TYPE=TD ATTR=TXT:Caste:
TAG POS=1 TYPE=TD ATTR=TXT:HINDU
TAG POS=1 TYPE=A ATTR=TXT:Update<SP>Verification<SP>Report
TAB T=2
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:printcasregistration_f ATTR=ID:LRDPlotNo CONTENT=0
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:printcasregistration_f ATTR=ID:extent CONTENT=0
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:printcasregistration_f ATTR=ID:TenantRecord CONTENT=NA
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:printcasregistration_f ATTR=ID:OriginalPatta_DraftKhatian_Parcha CONTENT=NA
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:printcasregistration_f ATTR=ID:MarriedFemaleLandSchedule CONTENT=NA
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:printcasregistration_f ATTR=ID:TraditionalOccupation CONTENT=FARMER
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:printcasregistration_f ATTR=ID:ApplicantNative CONTENT=INDIA
TAG POS=2 TYPE=INPUT:RADIO FORM=NAME:printcasregistration_f ATTR=ID:LandlessPerson
TAG POS=2 TYPE=INPUT:RADIO FORM=NAME:printcasregistration_f ATTR=ID:IsMigrated
TAG POS=2 TYPE=INPUT:RADIO FORM=NAME:printcasregistration_f ATTR=ID:IsPhotoVerified
TAG POS=1 TYPE=INPUT:RADIO FORM=NAME:printcasregistration_f ATTR=ID:CertificateIssue
TAG POS=1 TYPE=TEXTAREA FORM=NAME:printcasregistration_f ATTR=ID:Remarks CONTENT=As<SP>per<SP>attached<SP>documents<SP>applicant<SP>belongs<SP>to<SP>caste<SP>HINDU<SP>hence<SP>certificate<SP>may<SP>be<SP>issued
ONDIALOG POS=1 BUTTON=OK CONTENT=
ONDIALOG POS=2 BUTTON=OK CONTENT=
TAG POS=1 TYPE=INPUT:SUBMIT FORM=NAME:printcasregistration_f ATTR=ID:Submit
TAB T=1
TAG POS=1 TYPE=TEXTAREA FORM=NAME:fwddatailreport_f ATTR=ID:offRemarks_f CONTENT=As<SP>per<SP>attached<SP>documents<SP>applicant<SP>belongs<SP>to<SP>caste<SP>Hindu<SP>hence<SP>certificate<SP>may<SP>be<SP>issued
TAG POS=8 TYPE=TR ATTR=TXT:
TAG POS=1 TYPE=SELECT FORM=NAME:fwddatailreport_f ATTR=ID:status_f CONTENT=%F
TAG POS=1 TYPE=TD ATTR=TXT:Select<SP>Office<SP>---Select<SP>Office<SP>Type---Tahsil*
TAG POS=1 TYPE=SELECT FORM=NAME:fwddatailreport_f ATTR=ID:officeType_f CONTENT=%3
TAG POS=3 TYPE=INPUT:RADIO FORM=NAME:fwddatailreport_f ATTR=ID:Id_f
TAG POS=1 TYPE=INPUT:BUTTON FORM=NAME:fwddatailreport_f ATTR=NAME:OK
I have 2 Tabs and I want to copy two texts from the web page of Tab 1

Code: Select all

TAG POS=1 TYPE=TD ATTR=TXT:INDIA
I want to copy INDIA from Tab 1 and need to paste on the below Text box of Tab2

Code: Select all

TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:printcasregistration_f ATTR=ID:ApplicantNative CONTENT=INDIA
THEN

Code: Select all

TAG POS=1 TYPE=TD ATTR=TXT:HINDU
I want to copy HINDU from Tab 1 and need to paste on

Code: Select all

TAG POS=1 TYPE=TEXTAREA FORM=NAME:printcasregistration_f ATTR=ID:Remarks CONTENT=As<SP>per<SP>attached<SP>documents<SP>applicant<SP>belongs<SP>to<SP>caste<SP>.....HINDU.....<SP>hence<SP>certificate<SP>may<SP>be<SP>issued
What should be the change in the code ?
chivracq
Posts: 8409
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Fill the web page content from One Tab to Another Tab by copying specific Texts

Post by chivracq » Sun Jun 16, 2019 6:48 am

jyotirmaya wrote:
Sun Jun 16, 2019 6:23 am
I am using

Code: Select all

Browser Firefox 48.0
iMacros for Firefox v8.9.7
Windows 7 Professional 64-bit Operating system
I am using the below code.

Code: Select all

VERSION BUILD=8970419 RECORDER=FX
SET !ERRORIGNORE YES

TAB T=1
TAG POS=1 TYPE=TD ATTR=TXT:Village/Ward/Ward:
TAG POS=1 TYPE=TD ATTR=TXT:INDIA
TAG POS=1 TYPE=TD ATTR=TXT:Caste:
TAG POS=1 TYPE=TD ATTR=TXT:HINDU
TAG POS=1 TYPE=A ATTR=TXT:Update<SP>Verification<SP>Report
TAB T=2
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:printcasregistration_f ATTR=ID:LRDPlotNo CONTENT=0
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:printcasregistration_f ATTR=ID:extent CONTENT=0
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:printcasregistration_f ATTR=ID:TenantRecord CONTENT=NA
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:printcasregistration_f ATTR=ID:OriginalPatta_DraftKhatian_Parcha CONTENT=NA
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:printcasregistration_f ATTR=ID:MarriedFemaleLandSchedule CONTENT=NA
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:printcasregistration_f ATTR=ID:TraditionalOccupation CONTENT=FARMER
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:printcasregistration_f ATTR=ID:ApplicantNative CONTENT=INDIA
TAG POS=2 TYPE=INPUT:RADIO FORM=NAME:printcasregistration_f ATTR=ID:LandlessPerson
TAG POS=2 TYPE=INPUT:RADIO FORM=NAME:printcasregistration_f ATTR=ID:IsMigrated
TAG POS=2 TYPE=INPUT:RADIO FORM=NAME:printcasregistration_f ATTR=ID:IsPhotoVerified
TAG POS=1 TYPE=INPUT:RADIO FORM=NAME:printcasregistration_f ATTR=ID:CertificateIssue
TAG POS=1 TYPE=TEXTAREA FORM=NAME:printcasregistration_f ATTR=ID:Remarks CONTENT=As<SP>per<SP>attached<SP>documents<SP>applicant<SP>belongs<SP>to<SP>caste<SP>HINDU<SP>hence<SP>certificate<SP>may<SP>be<SP>issued
ONDIALOG POS=1 BUTTON=OK CONTENT=
ONDIALOG POS=2 BUTTON=OK CONTENT=
TAG POS=1 TYPE=INPUT:SUBMIT FORM=NAME:printcasregistration_f ATTR=ID:Submit
TAB T=1
TAG POS=1 TYPE=TEXTAREA FORM=NAME:fwddatailreport_f ATTR=ID:offRemarks_f CONTENT=As<SP>per<SP>attached<SP>documents<SP>applicant<SP>belongs<SP>to<SP>caste<SP>Hindu<SP>hence<SP>certificate<SP>may<SP>be<SP>issued
TAG POS=8 TYPE=TR ATTR=TXT:
TAG POS=1 TYPE=SELECT FORM=NAME:fwddatailreport_f ATTR=ID:status_f CONTENT=%F
TAG POS=1 TYPE=TD ATTR=TXT:Select<SP>Office<SP>---Select<SP>Office<SP>Type---Tahsil*
TAG POS=1 TYPE=SELECT FORM=NAME:fwddatailreport_f ATTR=ID:officeType_f CONTENT=%3
TAG POS=3 TYPE=INPUT:RADIO FORM=NAME:fwddatailreport_f ATTR=ID:Id_f
TAG POS=1 TYPE=INPUT:BUTTON FORM=NAME:fwddatailreport_f ATTR=NAME:OK
I have 2 Tabs and I want to copy two texts from the web page of Tab 1

Code: Select all

TAG POS=1 TYPE=TD ATTR=TXT:INDIA
I want to copy INDIA from Tab 1 and need to paste on the below Text box of Tab2

Code: Select all

TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:printcasregistration_f ATTR=ID:ApplicantNative CONTENT=INDIA
THEN

Code: Select all

TAG POS=1 TYPE=TD ATTR=TXT:HINDU
I want to copy HINDU from Tab 1 and need to paste on

Code: Select all

TAG POS=1 TYPE=TEXTAREA FORM=NAME:printcasregistration_f ATTR=ID:Remarks CONTENT=As<SP>per<SP>attached<SP>documents<SP>applicant<SP>belongs<SP>to<SP>caste<SP>.....HINDU.....<SP>hence<SP>certificate<SP>may<SP>be<SP>issued
What should be the change in the code ?
Yep, typical Usecase for the 'EXTRACT' Mechanism, just like "we" did in your previous Thread with the 'Village' Element.

This is a very basic Notion/Functionality of iMacros... If you are (still) not familiar with it (after using iMacros for nearly 3 years), check the Wiki about the 'EXTRACT' Command/Parameter + read the Section about 'Data Extraction' in the Wiki, and maybe read also a few Threads from the 'Data Extraction' Sub-Forum..., lots of Examples there as well... :idea:
And you also have a 'Demo_Extract-and-Fill.iim' Demo-Macro... 8)
- (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...
jyotirmaya
Posts: 37
Joined: Wed Jul 27, 2016 6:25 pm

Re: Fill the web page content from One Tab to Another Tab by copying specific Texts

Post by jyotirmaya » Sun Jun 16, 2019 7:22 am

Sorry you are right using for 3 years :) but....

when I tried to Extract

TAG POS=1 TYPE=TD ATTR=TXT:HINDU

by using this code

TAG POS=1 TYPE=TD ATTR=TXT:* EXTRACT=TXT
SET !VAR1 {{!EXTRACT}}
SET !EXTRACT NULL

It extracted blank text, please help me for this time, I am running out of time for the task, sorry for disturbing you always. I too want to do it by myself but not able to do due to lack of coding knowledge. I want to learn please tell me from where I should start.
chivracq
Posts: 8409
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Fill the web page content from One Tab to Another Tab by copying specific Texts

Post by chivracq » Sun Jun 16, 2019 12:30 pm

jyotirmaya wrote:
Sun Jun 16, 2019 7:22 am
Sorry you are right using for 3 years :) but....

when I tried to Extract

Code: Select all

TAG POS=1 TYPE=TD ATTR=TXT:HINDU
by using this code

Code: Select all

TAG POS=1 TYPE=TD ATTR=TXT:* EXTRACT=TXT
SET !VAR1 {{!EXTRACT}}
SET !EXTRACT NULL
It extracted blank text, please help me for this time, I am running out of time for the task, sorry for disturbing you always. I too want to do it by myself but not able to do due to lack of coding knowledge. I want to learn please tell me from where I should start.
Yeah, well, in the Wiki about 'Data Extraction', you have a Section about extracting Cells (=> your 'TD' Element(s)) from a Table using 'Relative Positioning' to be able to identify reliably the "correct" 'TD' Element... :idea:

=> The 'Anchor' for the "INDIA" Element will probably be the 'TYPE=TD ATTR=TXT:Village/Ward/Ward:' 'TAG' Statement and the 'Anchor' for the "HINDU" Element will probably be the 'TAG POS=1 TYPE=TD ATTR=TXT:Caste:' 'TAG' Statement.
=> With 'POS=R1' if the Data is displayed horizontally, or with 'POS=R5' for example if the Data is displayed in a "classic" Table with 5 Cols for example and n Rows and a Table Header.
- (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...
jyotirmaya
Posts: 37
Joined: Wed Jul 27, 2016 6:25 pm

Re: Fill the web page content from One Tab to Another Tab by copying specific Texts

Post by jyotirmaya » Mon Jun 17, 2019 2:50 pm

Ok, Thanks I am trying.... :? :)
chivracq
Posts: 8409
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Fill the web page content from One Tab to Another Tab by copying specific Texts

Post by chivracq » Mon Jun 17, 2019 3:38 pm

jyotirmaya wrote:
Mon Jun 17, 2019 2:50 pm
Ok, Thanks I am trying.... :? :)
Ah...!?, OK, I thought you would have already made a bit more "Progress", it's not very complicated, and again, it's a very basic Functionality of iMacros..., you should really read a bit of the Documentation and a few Threads on the Forum, and not only "at the last moment" when you have a Pb... But OK, never mind... :o

Yeah, well, what you need is stg like:

Code: Select all

'Extract 'Village':
'TAG POS=1 TYPE=TD ATTR=TXT:INDIA // (Recorded)
TAG POS=1 TYPE=TD ATTR=TXT:Village/Ward/Ward:
SET !EXTRACT NULL
TAG POS=R1 TYPE=TD ATTR=TXT:* EXTRACT=TXT
SET Village {{!EXTRACT}}
'>
'Extract 'Caste':
'TAG POS=1 TYPE=TD ATTR=TXT:HINDU // (Recorded)
TAG POS=1 TYPE=TD ATTR=TXT:Caste:
SET !EXTRACT NULL
TAG POS=R1 TYPE=TD ATTR=TXT:* EXTRACT=TXT
SET Caste {{!EXTRACT}}
'>
'Debug:
PROMPT Village:<SP>_{{Village}}_<BR>Caste:<SP>_{{Caste}}_
Well, I'm not sure about the 'POS=R1', I don't know how the Data is presented on that Page, you might have to play with the 'R1' => 'R2' / 'R3' / etc..., and to use the correct 'Anchors' as well of course...

And you then reuse the '{{Village}}' and '{{Caste}}' Vars wherever you need them in 'TAB_2'...
And mini-Advice, it's "better Practice" to use User-defined Vars and to give them "meaningful" Names, rather than using and reusing '!VAR[0-9]'.
- (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...
jyotirmaya
Posts: 37
Joined: Wed Jul 27, 2016 6:25 pm

Re: Fill the web page content from One Tab to Another Tab by copying specific Texts

Post by jyotirmaya » Mon Jun 17, 2019 5:11 pm

chivracq wrote:
Mon Jun 17, 2019 3:38 pm
jyotirmaya wrote:
Mon Jun 17, 2019 2:50 pm
Ok, Thanks I am trying.... :? :)
Ah...!?, OK, I thought you would have already made a bit more "Progress", it's not very complicated, and again, it's a very basic Functionality of iMacros..., you should really read a bit of the Documentation and a few Threads on the Forum, and not only "at the last moment" when you have a Pb... But OK, never mind... :o

Yeah, well, what you need is stg like:

Code: Select all

'Extract 'Village':
'TAG POS=1 TYPE=TD ATTR=TXT:INDIA // (Recorded)
TAG POS=1 TYPE=TD ATTR=TXT:Village/Ward/Ward:
SET !EXTRACT NULL
TAG POS=R1 TYPE=TD ATTR=TXT:* EXTRACT=TXT
SET Village {{!EXTRACT}}
'>
'Extract 'Caste':
'TAG POS=1 TYPE=TD ATTR=TXT:HINDU // (Recorded)
TAG POS=1 TYPE=TD ATTR=TXT:Caste:
SET !EXTRACT NULL
TAG POS=R1 TYPE=TD ATTR=TXT:* EXTRACT=TXT
SET Caste {{!EXTRACT}}
'>
'Debug:
PROMPT Village:<SP>_{{Village}}_<BR>Caste:<SP>_{{Caste}}_
Well, I'm not sure about the 'POS=R1', I don't know how the Data is presented on that Page, you might have to play with the 'R1' => 'R2' / 'R3' / etc..., and to use the correct 'Anchors' as well of course...

And you then reuse the '{{Village}}' and '{{Caste}}' Vars wherever you need them in 'TAB_2'...
And mini-Advice, it's "better Practice" to use User-defined Vars and to give them "meaningful" Names, rather than using and reusing '!VAR[0-9]'.
THANK YOU SO MUCH, It worked, I did 2,3 types of similar tasks based on this code, thanks for your advice and help, I have started learning :) :) :) :D :D
chivracq
Posts: 8409
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Fill the web page content from One Tab to Another Tab by copying specific Texts

Post by chivracq » Mon Jun 17, 2019 5:19 pm

jyotirmaya wrote:
Mon Jun 17, 2019 5:11 pm
THANK YOU SO MUCH, It worked, I did 2,3 types of similar tasks based on this code, thanks for your advice and help, I have started learning :) :) :) :D :D
Yeah, OK, good to hear that it's working now... :D

And yep, never too late to "start learning", after 3 years using iMacros, ah-ah...!, I was already doing more "complicated" things than the basic Functionality involved in this Thread, only 1 hour after I had "discovered" and installed iMacros, some 10 years ago now... :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...
Post Reply