Extracting when no Name: or ID:

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.

Extracting when no Name: or ID:

by zirjeo on Wed Nov 09, 2016 2:20 pm

Is there any way for me to extract the number 16435628 from the code below from a website given there is no Name: or ID:? Its the on the 5th line down below... Thanks


Code: Select all
<table class="table table-bordered table-responsive">
                <thead></thead>
                <tbody data-bind="foreach: Bills">
                    <tr data-bind="css: { altrow: $index()%2 }">
                        <td style="background-color: magenta;" data-bind="html: DisplayBillNumber"><a href="BillDetail.html?year=2016&amp;billno=435628&amp;parcel=25000710100000">16435628</a></td>
                        <td data-bind="text: DisplayBillType">Secured Annual</td>
                        <td class="textright" data-bind="html: DisplayLevyAmount"><a href="DirectLevy.html?year=2016&amp;billno=435628&amp;parcel=25000710100000">$193.94</a></td>
                        <td class="textright" data-bind="text: DisplayBillAmount">$1,448.88</td>
                        <td class="textright" data-bind="html: DisplayTaxStatus"><a href="BillDetail.html?year=2016&amp;billno=435628&amp;parcel=25000710100000">Click Here</a></td>
                    </tr>
                </tbody>
               
WIndows 10, IE11, VERSION BUILD=11.5.498.2403
zirjeo
 
Posts: 59
Joined: Thu Oct 27, 2016 6:49 pm

Re: Extracting when no Name: or ID:

by chivracq on Wed Nov 09, 2016 3:35 pm

zirjeo wrote:Is there any way for me to extract the number 16435628 from the code below from a website given there is no Name: or ID:? Its the on the 5th line down below... Thanks

Code: Select all
<table class="table table-bordered table-responsive">
                <thead></thead>
                <tbody data-bind="foreach: Bills">
                    <tr data-bind="css: { altrow: $index()%2 }">
                        <td style="background-color: magenta;" data-bind="html: DisplayBillNumber"><a href="BillDetail.html?year=2016&amp;billno=435628&amp;parcel=25000710100000">16435628</a></td>
                        <td data-bind="text: DisplayBillType">Secured Annual</td>
                        <td class="textright" data-bind="html: DisplayLevyAmount"><a href="DirectLevy.html?year=2016&amp;billno=435628&amp;parcel=25000710100000">$193.94</a></td>
                        <td class="textright" data-bind="text: DisplayBillAmount">$1,448.88</td>
                        <td class="textright" data-bind="html: DisplayTaxStatus"><a href="BillDetail.html?year=2016&amp;billno=435628&amp;parcel=25000710100000">Click Here</a></td>
                    </tr>
                </tbody>
               

Code: Select all
WIndows 10,
IE11,
VERSION BUILD=11.5.498.2403

Hum, putting your FCI in your Sig denotes a good intention but you should still mention it hard-coded in your OP when you open a Thread as you only have one dynamic Sig for the whole Forum and it can only indicate your current FCI, which will probably change in the future with later Updates and would actually render your Environment quite confusing to sbd reading the Thread in a few weeks/months/years...

>>>

For your Qt, yep, you can issue an 'EXTRACT=TXT' or 'EXTRACT=HTM' at the 'TABLE' or 'TBODY' or 'TR' or 'TD' or 'A' Level and manage to isolate it, probably with 'split()'.

Or even easier, you can use Relative Positioning if for example you can use the 'Secured Annual' Field as the Anchor, or the 'Click Here' Link, well..., any Field that will remain static:
Code: Select all
TAG POS=1 TYPE=TD ATTR=TXT:Secured<SP>Annual
TAG POS=R-1 TYPE=A ATTR=TXT:* EXTRACT=TXT
- (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: 6474
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: Extracting when no Name: or ID:

by zirjeo on Wed Nov 09, 2016 4:06 pm

Awesome!

I'm needing to extract that bill number so then I can make it find what to click on as that bill number is clickable. I'm not sure how else to make it find what to click on. So I duplicated your two lines and altered the last line. Probably not the neatest way, but it works! Thanks

Code: Select all
TAG POS=1 TYPE=TD ATTR=TXT:Secured<SP>Annual
TAG POS=R-1 TYPE=A ATTR=TXT:* EXTRACT=TXT
TAG POS=1 TYPE=TD ATTR=TXT:Secured<SP>Annual
TAG POS=R-1 TYPE=A ATTR=TXT:{{!EXTRACT}}
WIndows 10, IE11, VERSION BUILD=11.5.498.2403
zirjeo
 
Posts: 59
Joined: Thu Oct 27, 2016 6:49 pm

Re: Extracting when no Name: or ID:

by chivracq on Wed Nov 09, 2016 4:37 pm

zirjeo wrote:Awesome!

I'm needing to extract that bill number so then I can make it find what to click on as that bill number is clickable. I'm not sure how else to make it find what to click on. So I duplicated your two lines and altered the last line. Probably not the neatest way, but it works! Thanks

Code: Select all
TAG POS=1 TYPE=TD ATTR=TXT:Secured<SP>Annual
TAG POS=R-1 TYPE=A ATTR=TXT:* EXTRACT=TXT
TAG POS=1 TYPE=TD ATTR=TXT:Secured<SP>Annual
TAG POS=R-1 TYPE=A ATTR=TXT:{{!EXTRACT}}

Ah-ah...!, hum..., funny...! But if your 'Secured Annual' Field is good enough as an Anchor for Relative Positioning to your Link then you can directly tag it and click on it with simply:
Code: Select all
TAG POS=1 TYPE=TD ATTR=TXT:Secured<SP>Annual
TAG POS=R-1 TYPE=A ATTR=TXT:*

The 'EXTRACT' on the Link actually prevented to click on it...
- (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: 6474
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: Extracting when no Name: or ID:

by zirjeo on Wed Nov 09, 2016 10:25 pm

Ha that is funny, I kinda just circled around the long way to it. :)
WIndows 10, IE11, VERSION BUILD=11.5.498.2403
zirjeo
 
Posts: 59
Joined: Thu Oct 27, 2016 6:49 pm

Re: Extracting when no Name: or ID:

by chivracq on Fri Nov 11, 2016 1:34 pm

zirjeo wrote:Ha that is funny, I kinda just circled around the long way to it. :)

Yep..., exactly what I meant, ah-ah...!

And no offense, but this Thread is a perfect Example of the Importance for a User of explaining directly exactly what they want do in the end instead of coming with a first half-Question, which leads to a second half-Qt, etc... until we reach the final Goal..., for which we Advanced Users would have found directly a different Approach much more direct and efficient..., ah-ah...! 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...
chivracq
 
Posts: 6474
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: Extracting when no Name: or ID:

by zirjeo on Sat Nov 12, 2016 3:21 pm

How about the other post for the LA County site to enable the inquire button. Stumping you? :D
WIndows 10, IE11, VERSION BUILD=11.5.498.2403
zirjeo
 
Posts: 59
Joined: Thu Oct 27, 2016 6:49 pm

Re: Extracting when no Name: or ID:

by chivracq on Sat Nov 12, 2016 3:43 pm

zirjeo wrote:How about the other post for the LA County site to enable the inquire button. Stumping you? :D

Well then bump it directly instead of mentioning it here..., you've got so many Threads that I got a bit lost...
- (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: 6474
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)


Return to Data Extraction and Web Screen Scraping

Who is online

Users browsing this forum: No registered users and 4 guests

-->