littledevil 0 Posted January 10, 2016 Report Share Posted January 10, 2016 (edited) i have 5 items on a page now each item has time displayed below it with html i m trying to scrape the time for each item <span class="ticker">04</span>h<span class="ticker">35</span>m<span class="ticker">04</span>smy bot is set(#itemoffset, 0, "Global") loop(5) { set(#hrs, $scrape attribute($element offset($element offset(<class="ticker">, 0), #itemoffset), "innertext"), "Global") set(#mins, $scrape attribute($element offset($element offset(<class="ticker">, 1), #itemoffset), "innertext"), "Global") set(#seconds, $scrape attribute($element offset($element offset(<class="ticker">, 2), #itemoffset), "innertext"), "Global") add list to list(time, $list from text("{#hrs}:{#mins}:{#seconds}", ""), "Don\'t Delete", "Global") } wait(2) increment(#itemoffset)it works for the first item but as soon as item offset is incremented it no longer scrapes the hrs mins and secs. Edited January 10, 2016 by littledevil Quote Link to post Share on other sites
pash 504 Posted January 11, 2016 Report Share Posted January 11, 2016 It is difficult to help if No Information test. Quote Link to post Share on other sites
littledevil 0 Posted January 11, 2016 Author Report Share Posted January 11, 2016 e.g http://www.amazon.in/gp/goldbox/ref=nav_topnav_deals...under today's lighting deals are the items with time in each Quote Link to post Share on other sites
pash 504 Posted January 11, 2016 Report Share Posted January 11, 2016 try 1 comment("http://www.amazon.in/gp/goldbox/ref") set(#time,$scrape attribute(<id=w"*_time_remaining">,"innertext"),"Global") set(#time,$replace regular expression(#time,".*January",""),"Global") set(#time,$replace(#time," ",":"),"Global") set(#time,$replace regular expression(#time,"[^\\d\\n:]",""),"Global") add list to list(%time,$list from text(#time,$new line),"Don\'t Delete","Global") try 2 set(#itemoffset,6,"Global") loop(5) { set(#hrs,$scrape attribute($element offset(<class="ticker">,#itemoffset),"innertext"),"Global") increment(#itemoffset) set(#mins,$scrape attribute($element offset(<class="ticker">,#itemoffset),"innertext"),"Global") increment(#itemoffset) set(#seconds,$scrape attribute($element offset(<class="ticker">,#itemoffset),"innertext"),"Global") add item to list(%time,"{#hrs}:{#mins}:{#seconds}","Don\'t Delete","Global") increment(#itemoffset) } 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.