I want to copy a portion of the webpage

Discussions and Tech Support related to website data extraction, screen scraping and data mining using iMacros.

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.

I want to copy a portion of the webpage

by jyotirmaya on Wed Jul 27, 2016 11:36 am

I am trying to open the website http://164.100.140.80/RoRView.aspx where I will select the 1st option list box in District 1st option in list box Tahasil 1st option in Village name & then in Khatiyan 1st number in the list box then after clicking ROR Front page button a page will appear out of that I want to 1,2,3 Serial number data to clipboard. How to do this ?

Image
Image

I am using Firefox & Imacros for Firefox
jyotirmaya
 
Posts: 7
Joined: Wed Jul 27, 2016 11:25 am

Re: I want to copy a portion of the webpage

by chivracq on Thu Jul 28, 2016 1:21 am

jyotirmaya wrote:I am trying to open the website http://164.100.140.80/RoRView.aspx where I will select the 1st option list box in District 1st option in list box Tahasil 1st option in Village name & then in Khatiyan 1st number in the list box then after clicking ROR Front page button a page will appear out of that I want to 1,2,3 Serial number data to clipboard. How to do this ?

Image
Image

I am using Firefox & Imacros for Firefox

Sorry, CIM for me to have a look...! :mrgreen:

Oh...!. "I am using Firefox & Imacros for Firefox".... (Should be prominent at the Beginning of your Post, I don't read otherwise...)
=> Well, good start, => CIM=>FCIM...! :mrgreen: (Read my Sig for Required Info when you open a Thread, many Commands are not implemented for all Browsers/Versions)
- (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)

Re: I want to copy a portion of the webpage

by jyotirmaya on Thu Jul 28, 2016 7:24 am

Sorry for incomplete data, I am using Firefox 47.0.1 iMacros for Firefox 8.9.7 & Windows7 Proffessional 64-bit Operating system.
jyotirmaya
 
Posts: 7
Joined: Wed Jul 27, 2016 11:25 am

Re: I want to copy a portion of the webpage

by chivracq on Thu Jul 28, 2016 12:20 pm

jyotirmaya wrote:Sorry for incomplete data, I am using Firefox 47.0.1 iMacros for Firefox 8.9.7 & Windows7 Proffessional 64-bit Operating system.

Perfect...! :D

OK, I managed to have a look at your Site, and, hum, not very difficult to extract your Data, using Relative Positioning, I assumed that the "ଜମିଦାରଙ୍କ ନାମ ଓ ଖେୱାଟ ବା ଖତିୟାନର କ୍ରମିକ ନମ୍ବର" Cell/Header will always be present and that the Data in the following Cells will be changing...
Code: Select all
VERSION BUILD=8820413 RECORDER=FX
TAB T=1
SET !EXTRACT_TEST_POPUP NO

URL GOTO=http://164.100.140.80/RoRView.aspx
TAG POS=1 TYPE=LEGEND FORM=ID:aspnetForm ATTR=TXT:Select<SP>Location<SP>for<SP>RoR
TAG POS=1 TYPE=TD ATTR=TXT:District
TAG POS=1 TYPE=SELECT FORM=ID:aspnetForm ATTR=ID:ctl00_ContentPlaceHolder1_ddlDistrict CONTENT=%14
WAIT SECONDS=1
TAG POS=1 TYPE=TD ATTR=TXT:Tahasil
TAG POS=1 TYPE=SELECT FORM=ID:aspnetForm ATTR=ID:ctl00_ContentPlaceHolder1_ddlTahsil CONTENT=%1
WAIT SECONDS=1
TAG POS=1 TYPE=TD ATTR=TXT:Village
TAG POS=1 TYPE=SELECT FORM=ID:aspnetForm ATTR=ID:ctl00_ContentPlaceHolder1_ddlVillage CONTENT=%315
WAIT SECONDS=1
TAG POS=1 TYPE=SPAN ATTR=ID:ctl00_ContentPlaceHolder1_lblColumnName
TAG POS=1 TYPE=SELECT FORM=ID:aspnetForm ATTR=ID:ctl00_ContentPlaceHolder1_ddlBindData CONTENT=%1
WAIT SECONDS=1

TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:aspnetForm ATTR=ID:ctl00_ContentPlaceHolder1_btnRORFront

'TAG POS=1 TYPE=DIV ATTR=TXT:Schedule<SP>I<SP>Form<SP>No.39-A
'TAG POS=1 TYPE=TD ATTR=TXT:ଥାନା<SP>ନମ୍ବର<SP>:<SP>"149"
'Anchor:
TAG POS=1 TYPE=TD ATTR=TXT:ଜମିଦାରଙ୍କ<SP>ନାମ<SP>ଓ<SP>ଖେୱାଟ<SP>ବା<SP>ଖତିୟାନର<SP>କ୍ରମିକ*

'TAG POS=1 TYPE=TD ATTR=TXT:1)<SP>ଖତିୟାନର<SP>କ୍ରମିକ<SP>ନମ୍ବର
SET !EXTRACT NULL
TAG POS=R3 TYPE=TD ATTR=TXT:* EXTRACT=TXT
SET My_Data {{!EXTRACT}}

'TAG POS=1 TYPE=TD ATTR=TXT:1
SET !EXTRACT NULL
TAG POS=R1 TYPE=TD ATTR=TXT:* EXTRACT=TXT
ADD My_Data {{!EXTRACT}}

'TAG POS=1 TYPE=TD ATTR=TXT:2)<SP>ପ୍ରଜାର<SP>ନାମ,<SP>ପିତାର<SP>ନାମ,<SP>ଜାତି<SP>ଓ<SP>ବାସସ୍ଥ*
SET !EXTRACT NULL
TAG POS=R1 TYPE=TD ATTR=TXT:* EXTRACT=TXT
ADD My_Data {{!EXTRACT}}

SET !EXTRACT NULL
TAG POS=1 TYPE=SPAN ATTR=ID:gvfront_ctl02_lblName EXTRACT=TXT
'TAG POS=R1 TYPE=TD ATTR=TXT:* EXTRACT=TXT
ADD My_Data {{!EXTRACT}}

'TAG POS=1 TYPE=TD ATTR=TXT:3)<SP>ସ୍ଵତ୍ଵ
TAG POS=R1 TYPE=TD ATTR=TXT:* EXTRACT=TXT
ADD My_Data {{!EXTRACT}}

'TAG POS=1 TYPE=TD ATTR=TXT:ସ୍ଥିତିବାନ
SET !EXTRACT NULL
TAG POS=R1 TYPE=TD ATTR=TXT:* EXTRACT=TXT
ADD My_Data {{!EXTRACT}}

'PROMPT {{!EXTRACT}}
'PROMPT {{My_Data}}

SET !CLIPBOARD {{My_Data}}
PROMPT {{!CLIPBOARD}}


=> Data copied to the Clipboard:
1) ଖତିୟାନର କ୍ରମିକ ନମ୍ବର




1




2) ପ୍ରଜାର ନାମ, ପିତାର ନାମ, ଜାତି ଓ ବାସସ୍ଥାନ
ଅକୁର ପଧାନ, ରତ୍ନାକର ପଧାନ ପି :କମାର ପଧାନ, ହେମ ପଧାନ ସ୍ଵା :କମାର ପଧାନ ଜା: ତନ୍ତି ବା: ନିଜଗାଁ
3) ସ୍ଵତ୍ଵ




ସ୍ଥିତିବାନ



(Tested on iMacros for FF v8.8.2, Pale Moon v26.3.3 (=FF47), Win10-x64.)

I already cleaned the Extracted Data a bit by using a Temp Var to store the Content of each Extract to remove all the "[EXTRACT]" Separators instead of using the Raw Extract..., if you want to clean the Data even further by removing all unnecessary Spaces and Returns, you can use 'EVAL()' + 'trim()' on each '!EXTRACT' before adding it to the Temp Var 'My_Data'...
- (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)

Re: I want to copy a portion of the webpage

by jyotirmaya on Thu Jul 28, 2016 7:39 pm

:) :) You are just awesome, Thank you so so much, I dont have coding experience that's why I am unable to do these things. I want one more help from you. After copying the data in the page there is a button in blue color Khatiyan page. I want that button to be clicked with that click it will return to the previous webpage. District List box Tahasil list box village name list box will be remain same. Just the select Khatiyan Number will be the next number should be selected. Then again the same procedure ROR front page will be clicked and the data will be copied,again Khatiyan Page will be clicked & will select the next number in the list box and so on up to the last number in the list box.

I have changed the District list box to 5 tahasil list box village to 4 name list box to 42 as per my requirement. I need to copy data again I need to back to the previous page & so on.


Code: Select all
TAG POS=1 TYPE=SELECT FORM=ID:aspnetForm ATTR=ID:ctl00_ContentPlaceHolder1_ddlBindData CONTENT=%1


1. So for that in the above line the CONTENT=%1 should be changed to 1 2 3 & so on. SO whether I need to copy the code from that point up to returning to the previous page & need to change the value of CONTENT ?? or any other method is available ??

2 . One more thing Is there any problem with this code if the same webpage is taking 15 seconds to load instead of 5 seconds in that case it will continue or will stop ? or the webpage loading time is considered automatically ? if the webpage loaded then it will copy ?

I have changed the code for the list box Content 1 & 2 like this. Kindly let me know if any other method is there.



Code: Select all
VERSION BUILD=8820413 RECORDER=FX
    TAB T=1
    SET !EXTRACT_TEST_POPUP NO

    URL GOTO=http://164.100.140.80/RoRView.aspx
    TAG POS=1 TYPE=LEGEND FORM=ID:aspnetForm ATTR=TXT:Select<SP>Location<SP>for<SP>RoR
    TAG POS=1 TYPE=TD ATTR=TXT:District
    TAG POS=1 TYPE=SELECT FORM=ID:aspnetForm ATTR=ID:ctl00_ContentPlaceHolder1_ddlDistrict CONTENT=%5
    WAIT SECONDS=1
    TAG POS=1 TYPE=TD ATTR=TXT:Tahasil
    TAG POS=1 TYPE=SELECT FORM=ID:aspnetForm ATTR=ID:ctl00_ContentPlaceHolder1_ddlTahsil CONTENT=%4
    WAIT SECONDS=1
    TAG POS=1 TYPE=TD ATTR=TXT:Village
    TAG POS=1 TYPE=SELECT FORM=ID:aspnetForm ATTR=ID:ctl00_ContentPlaceHolder1_ddlVillage CONTENT=%42
    WAIT SECONDS=1
    TAG POS=1 TYPE=SPAN ATTR=ID:ctl00_ContentPlaceHolder1_lblColumnName
    TAG POS=1 TYPE=SELECT FORM=ID:aspnetForm ATTR=ID:ctl00_ContentPlaceHolder1_ddlBindData CONTENT=%1
    WAIT SECONDS=1

    TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:aspnetForm ATTR=ID:ctl00_ContentPlaceHolder1_btnRORFront

    'TAG POS=1 TYPE=DIV ATTR=TXT:Schedule<SP>I<SP>Form<SP>No.39-A
    'TAG POS=1 TYPE=TD ATTR=TXT:ଥାନା<SP>ନମ୍ବର<SP>:<SP>"149"
    'Anchor:
    TAG POS=1 TYPE=TD ATTR=TXT:ଜମିଦାରଙ୍କ<SP>ନାମ<SP>ଓ<SP>ଖେୱାଟ<SP>ବା<SP>ଖତିୟାନର<SP>କ୍ରମିକ*

    'TAG POS=1 TYPE=TD ATTR=TXT:1)<SP>ଖତିୟାନର<SP>କ୍ରମିକ<SP>ନମ୍ବର
    SET !EXTRACT NULL
    TAG POS=R3 TYPE=TD ATTR=TXT:* EXTRACT=TXT
    SET My_Data {{!EXTRACT}}

    'TAG POS=1 TYPE=TD ATTR=TXT:1
    SET !EXTRACT NULL
    TAG POS=R1 TYPE=TD ATTR=TXT:* EXTRACT=TXT
    ADD My_Data {{!EXTRACT}}

    'TAG POS=1 TYPE=TD ATTR=TXT:2)<SP>ପ୍ରଜାର<SP>ନାମ,<SP>ପିତାର<SP>ନାମ,<SP>ଜାତି<SP>ଓ<SP>ବାସସ୍ଥ*
    SET !EXTRACT NULL
    TAG POS=R1 TYPE=TD ATTR=TXT:* EXTRACT=TXT
    ADD My_Data {{!EXTRACT}}

    SET !EXTRACT NULL
    TAG POS=1 TYPE=SPAN ATTR=ID:gvfront_ctl02_lblName EXTRACT=TXT
    'TAG POS=R1 TYPE=TD ATTR=TXT:* EXTRACT=TXT
    ADD My_Data {{!EXTRACT}}

    'TAG POS=1 TYPE=TD ATTR=TXT:3)<SP>ସ୍ଵତ୍ଵ
    TAG POS=R1 TYPE=TD ATTR=TXT:* EXTRACT=TXT
    ADD My_Data {{!EXTRACT}}

    'TAG POS=1 TYPE=TD ATTR=TXT:ସ୍ଥିତିବାନ
    SET !EXTRACT NULL
    TAG POS=R1 TYPE=TD ATTR=TXT:* EXTRACT=TXT
    ADD My_Data {{!EXTRACT}}

    'PROMPT {{!EXTRACT}}
    'PROMPT {{My_Data}}

    SET !CLIPBOARD {{My_Data}}
   TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:form1 ATTR=ID:btnKhatiyan
    TAG POS=1 TYPE=SPAN ATTR=ID:ctl00_ContentPlaceHolder1_lblColumnName
    TAG POS=1 TYPE=SELECT FORM=ID:aspnetForm ATTR=ID:ctl00_ContentPlaceHolder1_ddlBindData CONTENT=%2
    WAIT SECONDS=1

    TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:aspnetForm ATTR=ID:ctl00_ContentPlaceHolder1_btnRORFront

    'TAG POS=1 TYPE=DIV ATTR=TXT:Schedule<SP>I<SP>Form<SP>No.39-A
    'TAG POS=1 TYPE=TD ATTR=TXT:ଥାନା<SP>ନମ୍ବର<SP>:<SP>"149"
    'Anchor:
    TAG POS=1 TYPE=TD ATTR=TXT:ଜମିଦାରଙ୍କ<SP>ନାମ<SP>ଓ<SP>ଖେୱାଟ<SP>ବା<SP>ଖତିୟାନର<SP>କ୍ରମିକ*

    'TAG POS=1 TYPE=TD ATTR=TXT:1)<SP>ଖତିୟାନର<SP>କ୍ରମିକ<SP>ନମ୍ବର
    SET !EXTRACT NULL
    TAG POS=R3 TYPE=TD ATTR=TXT:* EXTRACT=TXT
    SET My_Data {{!EXTRACT}}

    'TAG POS=1 TYPE=TD ATTR=TXT:1
    SET !EXTRACT NULL
    TAG POS=R1 TYPE=TD ATTR=TXT:* EXTRACT=TXT
    ADD My_Data {{!EXTRACT}}

    'TAG POS=1 TYPE=TD ATTR=TXT:2)<SP>ପ୍ରଜାର<SP>ନାମ,<SP>ପିତାର<SP>ନାମ,<SP>ଜାତି<SP>ଓ<SP>ବାସସ୍ଥ*
    SET !EXTRACT NULL
    TAG POS=R1 TYPE=TD ATTR=TXT:* EXTRACT=TXT
    ADD My_Data {{!EXTRACT}}

    SET !EXTRACT NULL
    TAG POS=1 TYPE=SPAN ATTR=ID:gvfront_ctl02_lblName EXTRACT=TXT
    'TAG POS=R1 TYPE=TD ATTR=TXT:* EXTRACT=TXT
    ADD My_Data {{!EXTRACT}}

    'TAG POS=1 TYPE=TD ATTR=TXT:3)<SP>ସ୍ଵତ୍ଵ
    TAG POS=R1 TYPE=TD ATTR=TXT:* EXTRACT=TXT
    ADD My_Data {{!EXTRACT}}

    'TAG POS=1 TYPE=TD ATTR=TXT:ସ୍ଥିତିବାନ
    SET !EXTRACT NULL
    TAG POS=R1 TYPE=TD ATTR=TXT:* EXTRACT=TXT
    ADD My_Data {{!EXTRACT}}

    'PROMPT {{!EXTRACT}}
    'PROMPT {{My_Data}}

    SET !CLIPBOARD {{My_Data}}
   TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:form1 ATTR=ID:btnKhatiyan
jyotirmaya
 
Posts: 7
Joined: Wed Jul 27, 2016 11:25 am


Return to Data Extraction and Web Screen Scraping

Who is online

Users browsing this forum: No registered users and 4 guests

-->