Jump to content
UBot Underground

How To Extract The Innertext Of The Following Example?


Recommended Posts

I have tried many ways to extract the innerText from the following but I cannot. The attachment shows the rudimentary nodes.

 

The Advanced Element Editor for that class is here...

 

<div class="competitor-details">
                      <div class="racing-details">
                        <div class="competitor-info__main">
                        <span class="competitor-info__horse-name horse-hover-trigger hover-trigger--509635" data-sid="509635">
                          <a href="https://www.punters.com.au/horses/flying-trapeze_509635/"rel="Flying Trapeze's Profile">
                            <span class="competitor-number">1. </span>
                          Flying Trapeze
                            <span class="competitor-info__barrier-number">(2)</span>
                          </a>
                        </span>
                        </div>
                            
                              <span class="competitor-info__jockey-name">
                                  <b>J:</b>
                                  <a href="https://www.punters.com.au/jockeys/jake-bayliss_3277/"rel="Jake Bayliss's Profile">Jake Bayliss</a>
                                58.5kg
                              </span>
                      </div>
                    </div>
 
Thank you

post-31388-0-24793900-1518526496_thumb.jpg

Link to post
Share on other sites

Thank you BotGuru.

 

Yes I was missing the innertext attribute.

 

But after I enter it there is only 1 entry in the list horses and it is the first horse/jockey but I know there are 40+ such identical classes. (I do some web programming and know how to interpret HTML, CSS etc)

 

Here is the source code.

 

navigate("https://www.punters.com.au/odds-comparison/horse-racing/australia-new-zealand/2018-02-14/","Wait")
clear list(%horses)
add list to list(%horses,$scrape attribute($element offset(<class="competitor-details">,0),"innertext"),"Don\'t Delete","Global")

 

Thanks in advance

Link to post
Share on other sites

Thanks TJ

 

But I am unclear exactly what you mean by the above.

 

When I set offset to "" like so "add list to list(%horses,$scrape attribute($element offset(<class="competitor-details">,""),"innertext"),"Don\'t Delete","Global")"
I get a run-time error.

 

Error: Conversion from string "" to type 'Integer' is not valid.

 

I have tried all sort of combinations of remove the word 'offset' and adjusting the following delimiters like '(', ')', ',' in the Source View but I then get code errors. Squiggly red underlines.

 

I'm stuck.

 

Can you please alter my 'add list to list' code to demonstrate exactly how it should be.

 

EDIT:
If anyone wants to run the code just change the date at the end of the Navigate URL to current or next day. The date format is yyyy-mm-dd and then select a race from the WHERE drop-down list.

Edited by ThomasAJ
Link to post
Share on other sites

I may know what the problem is (or not)?

 

So I add '$scrape attribute' to 'List To Add' as shown below (all normal and it is identical to what I see in the learning videos) 

 

http://d29u7d0naxols0.cloudfront.net/Ubot/UbotNoElementOffset.jpg

 

Then I use '<>' to carefully select the DIV that surrounds the innertext that I want to scrape BUT the '$element offset' gets inserted automatically as shown below.

 

http://d29u7d0naxols0.cloudfront.net/Ubot/UbotElementOffset.jpg

 

This automatic insertion of '$element offset'  does not occur in learning videos at UBOT and it is not required according to TJ in his prior post.

The class that I am after is correct.

PLEASE IGNORE EMPTY 'Attribute To Scrape' in the picture. I have it there when running the bot.

 

I have the latest UBOT.

 

EDIT: In the top picture if I type in <class=competitor-details> into 'Element To Scrape' and select the Attribute To Scrape from the drop down and hit OK I get an 'Invalid Parameter' error message.

Edited by ThomasAJ
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...