contenthydra 0 Posted June 27, 2017 Report Share Posted June 27, 2017 Hi guys, been tinkering around with uBot more and more and I'm trying to develop a scraping bot for myself but I'm running into trouble.When I create a command that goes to scrape a certain part of information, it's all under the same div class, so it scrapes a bulk information like the following as an example: (FYI: I tried using offsets, wildcards, etc and it's either It doesn't work or scrapes everything on the page) Fruits: Bananas, Apples, WatermelonColor: Yellow, Red, Yellow, GreenFlavor: Sweet, SourShape: Long, Round, Oval So once I got all this information saved as a variable (#fruit), how do I edit this? I don't want all the information above, and I actually just want Shape: Long, Round, Oval. How would I trim off the excess stuff so just Shape: Long, Round, Oval is saved to #fruit? Thanks Quote Link to post Share on other sites
HelloInsomnia 1103 Posted June 27, 2017 Report Share Posted June 27, 2017 Try this: set(#scraped,"Fruits: Bananas, Apples, Watermelon Color: Yellow, Red, Yellow, Green Flavor: Sweet, Sour Shape: Long, Round, Oval","Global") set(#shapes,$find regular expression(#scraped,"(?<=Shape\\:\\s).*$"),"Global") set(#shapesWithoutSpaces,$replace(#shapes,", ",","),"Global") clear list(%shapes) add list to list(%shapes,$list from text(#shapesWithoutSpaces,","),"Delete","Global") 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.