kamran 0 Posted July 13, 2010 Report Share Posted July 13, 2010 Hi,I am trying to automate selection of a category inhttp://www.rssbuffet.com/submit.phpAs you can see in the site, the category is a category tree. How is it possible to automate this. Any ideas? Quote Link to post Share on other sites
Praney Behl 314 Posted July 14, 2010 Report Share Posted July 14, 2010 Do you wanna select a specific category or just random? Quote Link to post Share on other sites
kamran 0 Posted July 14, 2010 Author Report Share Posted July 14, 2010 Hi PraneyBehl,Thanks for the reply. I want to select just a random category. Quote Link to post Share on other sites
Praney Behl 314 Posted July 14, 2010 Report Share Posted July 14, 2010 ok give me a couple of mins i'll do the code for you.. Quote Link to post Share on other sites
Praney Behl 314 Posted July 14, 2010 Report Share Posted July 14, 2010 Ok now here is a sample code to give you an idea on how this can be done is.Sample script Ok now in this I have used 3 variables: a, b, & c. Ok to my experience it can be done by choosing by position. Variables a,b,c are position variables, Now first we clicked on the: "Click here to Choose Category" link by selecting the choose by attribute. then click it. ->Arts & HistoryCommerceComputers & InternetHealthHobbiesHome & LivingMediaMusic & MoviesOutdoorsRegionalReligionScience & TechnologySocial NetworkingSocietySports Now these link start at position 11 and last is 25. Thus, we set 'a' = rand(11,25); Now we click(select) a random main category; lets say it selected 14: "Health"It has 20 sub-cats. :Alternative HealthAnatomyAsthmaBeautyBodybuildingBrain DisordersCancerEating DisordersErgonomicsFitnessLearning DisordersMedical ScienceMental HealthNursingNutritionPsychiatrySelf ImprovementSexual HealthSubstance AbuseWeight Loss And all have different positions, so we need to check the position of the first and the last sub-cat. Right click the first sub-cat and choose by pos. note the no. and do same with last. Ok now varibles 'b' and 'c': 'b' is the value of the first sub-cat and 'c' is the value of the last sub-cat. This needs to be done manually as they all have diff no. of sub-cats. Its a pain in the butt.. Now that we have all the values of all sub-cats. of all cats. we run a check using if statements checking if the value of 'a' is "sumthing" then set 'b' = first sub-cat pos. of that cat. and same with the 'c'. Hey in the sample script above I have done the first 4 IF Statement for you but as there were 16 so I have left the other 12 for you to do.. Enjoy... Get back to me if you have any doubt I think that it may not be the case after this huge explaination... Cheers!! Praney 4 Quote Link to post Share on other sites
alcr 135 Posted July 14, 2010 Report Share Posted July 14, 2010 Hahaha I don't think he will have any questions after that explanation no gj! Quote Link to post Share on other sites
kamran 0 Posted July 18, 2010 Author Report Share Posted July 18, 2010 Thanks a lot PraneyBehl, it works except that it throws an error sometimes, so I changed the initial setting of variable b and c to 0 instead of $nothing. Now it works fine Quote Link to post Share on other sites
Praney Behl 314 Posted July 18, 2010 Report Share Posted July 18, 2010 Enjoy buddy Quote Link to post Share on other sites
Net66 54 Posted July 18, 2010 Report Share Posted July 18, 2010 Excellent explanation! Quote Link to post Share on other sites
Praney Behl 314 Posted July 18, 2010 Report Share Posted July 18, 2010 Excellent explanation! Thanks Nett66 I had some time in hand the other day, and I know how it feels to be a newbie with Ubot...LOL 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.