Jump to content
UBot Underground

How To Edit An Attribute Once Scraped?


Recommended Posts

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, Watermelon

Color: Yellow, Red, Yellow, Green

Flavor: Sweet, Sour

Shape: 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

Link to post
Share on other sites

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")
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...