stanf 43 Posted September 17, 2012 Report Share Posted September 17, 2012 can someone tell me why the the condition to end the first loop is not being met?amazon-loop1.ubot Quote Link to post Share on other sites
k1lv9h 76 Posted September 17, 2012 Report Share Posted September 17, 2012 Hi, Sample code:amazon-statf-loop1-001.ubot Kevin Quote Link to post Share on other sites
stanf 43 Posted September 18, 2012 Author Report Share Posted September 18, 2012 thanx kevinyour code showed me that it did not need to be so complicated,( just give the loop a set number of times to loop) but i have another problem. I understand, I just find the total number of items and divide by 10, but how do you convert a string to a intiger to perform math on it.scraping the total number of items and performing ($eval (%totalitems /10)) gives the error cannot divide two strings Quote Link to post Share on other sites
k1lv9h 76 Posted September 18, 2012 Report Share Posted September 18, 2012 Hi, ($eval (%totalitems /10))Is %totalitems a list? The % is used for ubot lists.. To get count of total items in a list use $list total(%totalitems).($eval ($list total(%totalitems) / 10)) Kevin Quote Link to post Share on other sites
stanf 43 Posted September 19, 2012 Author Report Share Posted September 19, 2012 this is the problem .amazon search shows 250 items "1 - 10 of 250 Results" , I page scrape the left side(of) ---right side (Results)= %item count or #item countthat gives me 250 to add as a line in a list or make a variable, in this case , the math would be ******************************************************this fails "cannot divide 2 strings****************set loop count= (($eval (%item count or #item count / 10))************************************************************************** I want to use loop times (loop count) Quote Link to post Share on other sites
blumi40 222 Posted September 19, 2012 Report Share Posted September 19, 2012 .. Quote Link to post Share on other sites
blumi40 222 Posted September 19, 2012 Report Share Posted September 19, 2012 Hope thats what u looking foramazonloop-blumi_2.ubot Quote Link to post Share on other sites
stanf 43 Posted September 19, 2012 Author Report Share Posted September 19, 2012 thanx for your input but thats not where i was going.I could just give the loop count a a number of 100 and pretty much be sure to get all the links.But the object was to be able to figure out how many loops if the item count were to change.(this bot will go thruall amazon items i wish to sell and add the links to a link list script. and then i can rss blast all catagories and buildindivisual pages to search engine market. I have made progress in isolating the number of total items.since the first page will always show " Showing 1-10 of ### Results"I just did a replace (Showinf 1 -10 of) = " " replace (Results) = " "but I still cant do math funtions (* \ + -) on ### p.s. I understand that sooner or later I will have to learn regex, it will make future projects easier Quote Link to post Share on other sites
a2mateit 395 Posted September 19, 2012 Report Share Posted September 19, 2012 Have you tried scraping the number of results aka ###, and then setting that as a variable and calling it in a loop as the number of cycles? That should accomplish what you are trying to do without needing to do any math. If you give me an exact url, I can try to mock something up for you. Quote Link to post Share on other sites
blumi40 222 Posted September 19, 2012 Report Share Posted September 19, 2012 i real dont know what ya mean sorry Quote Link to post Share on other sites
k1lv9h 76 Posted September 19, 2012 Report Share Posted September 19, 2012 Hi, Sample code for the math issue:amazon-stanf-calc-001.ubot Kevin Quote Link to post Share on other sites
JohnB 255 Posted September 19, 2012 Report Share Posted September 19, 2012 I have a video on this: http://learnubot.com/version35/ubot-tutorial-v4-javascript-calculate-loop-cycles/ John Quote Link to post Share on other sites
stanf 43 Posted September 23, 2012 Author Report Share Posted September 23, 2012 thanx john that was quick and to the point.kevin i appreciate your help ,but that was to complicated for me at the moment ( i aint got that far yet) 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.