Jump to content
UBot Underground

Parent, Child and Sibling learning/helping search bot


Recommended Posts

This tool/code was inspired by Ubotbuddy and his video highlted here... http://www.ubotstudio.com/forum/index.php?/topic/11910-free-start-your-learning-now-with-free-training/?hl=child&do=findComment&comment=64449

 

Wanted to share some source code to help find parents, childs and siblings. The source code will find each item up to 12 instances out for both lists and  variables. I created a short video to help understand how to use the tool/source code, but haven't been able to get it uploaded. :(

 

For both Pro & Dev users I'd suggest making changes by cutting and pasting the code into a text editor, then search and replace and paste it back into Ubot.

 

For the Standard version, everything has to be done by hand. :(

 

Please feel free to share or use this code in your projects (it is very basic, but should be a time saver).

parents child siblings example code.ubot

Link to post
Share on other sites
  • 4 months later...
Is that a video that can be shared on YouTube?

I could really use this, just need to figure out how to use it.

 

 

I tried using it, based on the RankSignals example, and see that it returns only Parent elements, no Child or Sibling.

.

..

...

(my bad)

I was trying to run through it too quickly, didn't see that it is split into different process tabs for each PARENT, CHILD, SIBLING, et al.
Link to post
Share on other sites
uBot v4.2.20:

 

If I conduct an OuterHtml attribute of a PARENT element, the scrape returns all HTML that surrounds the 

class="all-categories-list", however, in the following example, if I scrape the OuterHtml attribute of a CHILD element, shouldn't it return a value of the child tag, such as "<li>" instead of blank/nothing?

 

 

SOURCE:

 

<ul class="all-categories-list">

 <li>

  <h2>


         Arts and Entertainment

       </a>

  </h2>

 </li>

 <li>

  <h2>


         Autos and Vehicles

       </a>

  </h2>

 </li>

</ul>

 

 

UBOT CODE:

set(#var1, $scrape attribute($element child(<class="all-categories-list">), "outerhtml"), "Global")

 

 

 

My goal is to read the HREF for each list item, yet I still haven't found the right combination of sibling or child elements that would return the HREF for each yet.

 

 

set(#var2, $scrape attribute($element child($element child($element child($element child(<class="all-categories-list">)))), "outerhtml"), "Global")

 

I've tried 1,2,3,4,5 levels of child element, sibling, etc, always returning a blank value.

 

Any advice is appreciated.

Link to post
Share on other sites
  • 1 month later...

I've encountered this issue also great2bme.. it appears as though element child does not work properly - as it did way back in Ubot 3.5.  

 

There are way more instances now (Ubot 4 and 5) when element child returns a blank value even though you can see there is a child in the advanced element editor, and then really the only way to get that attribute is to scrape the whole thing and edit the string.

Link to post
Share on other sites

UBot 3.5 was the best implementation of Parent/Sibling/Child.  V4 it went down to an even worse level. 

 

I gave up using them due to their instability.

 

I could never get my opinion on the matter to be addressed.  I have used it in v4 BUT it takes quite a bit of testing testing and even more testing to ensure that you get it right. Its a far cry from v3.5

Link to post
Share on other sites

I think it's interesting that you got it working at all in V4 UbbotBuddy I thought I was the only one until I saw one of your videos talking about how child wasn't working right in v4.

 

I couldn't even get the most basic example - based on some html shown in the Ubot documentation to run properly.

set(#pageText, "<html>
  <head>
    <title>DOM Tutorial</title>
  </head>
  <body>
    <h1>DOM Lesson one</h1>
    <p>Hello world!</p>
  </body>
</html>", "Global")
load html(#pageText)
alert($scrape attribute($element child(<tagname="body">), "outerhtml"))

That returns nothing in Ubot 4 and 5.

Link to post
Share on other sites

I agree.  Such powerful concepts and they abandoned them.

 

I use Regex whenever I can now to grab the detail that I need since the parent stuff is useless in many of the things that I deal with.

 

Buddy

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...