big dog status 2 Posted October 17, 2013 Report Share Posted October 17, 2013 Hi guys and girls, In my current bot I am scraping a message that the user has sent. The problem is I want to scrape the newest message they sent and each conversation is different because some send one message, some send dozens.. So is there a way to obtain the total offsets for that particular element? So.. If userA has just sent three mesages, I will scrape the element containing the message, with an offset of 3 to get the latest message, etc If userB has just sent 5 messages, I will scrape the element containing the message, with an offset this time of 5, to get the latest message. Is this possible? It must be. Thanks in advance for any help. Quote Link to post Share on other sites
HelloInsomnia 1103 Posted October 17, 2013 Report Share Posted October 17, 2013 Yes but the offset for 3 would be 2 and 5 would be 4 because the first offset position starts at 0. 1 Quote Link to post Share on other sites
big dog status 2 Posted October 17, 2013 Author Report Share Posted October 17, 2013 Hey thanks for your help and the reminder to start at 0. My question is though, how can I determine how many elements there are at that particular time and then chose the highest number? When we make our bots ubot studio will tell us how many element offsets there are for a particular element but how can we determine this within the bot itself? Thanks ;0) Quote Link to post Share on other sites
HelloInsomnia 1103 Posted October 17, 2013 Report Share Posted October 17, 2013 Add them into a list and make sure you set it to not delete the duplicates. Then just get the list total and that's how many there are. Quote Link to post Share on other sites
big dog status 2 Posted October 17, 2013 Author Report Share Posted October 17, 2013 Perfect, great idea. thanks!!11one11!! 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.