ThomasAJ 0 Posted February 13, 2018 Report Share Posted February 13, 2018 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 Quote Link to post Share on other sites
LoWrIdErTJ - BotGuru 904 Posted February 13, 2018 Report Share Posted February 13, 2018 attribute to scrape from screenshot set to inner text Quote Link to post Share on other sites
ThomasAJ 0 Posted February 14, 2018 Author Report Share Posted February 14, 2018 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 Quote Link to post Share on other sites
LoWrIdErTJ - BotGuru 904 Posted February 14, 2018 Report Share Posted February 14, 2018 remove the element offset that is setting position 0 (its index based first one will start at 0) and just use the <class="competitor-details"> instead of element offset Quote Link to post Share on other sites
ThomasAJ 0 Posted February 15, 2018 Author Report Share Posted February 15, 2018 (edited) 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 February 15, 2018 by ThomasAJ Quote Link to post Share on other sites
ThomasAJ 0 Posted February 15, 2018 Author Report Share Posted February 15, 2018 (edited) 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 February 15, 2018 by ThomasAJ Quote Link to post Share on other sites
LoWrIdErTJ - BotGuru 904 Posted February 15, 2018 Report Share Posted February 15, 2018 add list to list(%horses,$scrape attribute(<class="competitor-details">,"innertext"),"Don\'t Delete","Global") note just removed the element offset Quote Link to post Share on other sites
ThomasAJ 0 Posted February 16, 2018 Author Report Share Posted February 16, 2018 Thank you - perfect. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.