Jump to content
UBot Underground

Trying to match new line character


Recommended Posts

Hello all,

 

Been having a bit of a problem with uBot 5.  I am unable to match/capture a new line.  I first tried to pull the data with "Scrape Attribute" and using "child element" (or whatever it's called).  Anyway, here's the code you can see what I am trying to do. 

<tr class="session_1008488717" style="display: table-row; ">
								<td class="Present">
									<input id="1184475242" onchange="$(this).addClass('dirty');" type="checkbox">
								</td>
								<td>John Doe</td>
								<td>JohnDoe@google.com</td>
								<td>Active</td>
							</tr>

The number "1008488717" is my best identifier in this massive document to drill down and grab the person's ID (1184475242), Name (John Doe), and Email.  My goal was to rip the entire line from "session_1008488717" onward to the last </tr> element (or similar).   I could throw this into a list (new lines and all).  From there, sort it out to the three elements above. 

 

However, I am not able to match the new line any which way. All of the following have failed to match the new line character (I'm not going to bother w/ the additional code to match each line at this point)...

  • \n
  • \p
  • \l
  • $[^a].*^     (this was cheap, but still didn't work)

-------------------------------------------------------------------------------------------------------------------------------

I then tried something even more simplistic.  I went back and tried something entirely new.  Using the new code below, I still cannot match any new line characters.  Please note, I did not complete the examples below b/c I lost the highlighted pattern in the RegEx Editor the moment I put in the "\".

alpha
beta
charlie
delta
echo
  • alpha.*\r
  • alpha.*\l
  • alpha.*\p
  • alpha.*\n

-------------------------------------------------------------------------------------------------------------------------------

I think you get my point.  Ultimately, I would be happy to capture this data in any way possible (including going back to scrape attribute/innertext/child, etc.).  But that also does not seem to work for me.  To be clear, there are many of these line items within the HTML document, so a simple "substring" will also not work nicely (short of a loop).

 

Any suggestions?

 

Thanks again in advance.

Link to post
Share on other sites

Before you spend a lot of time troubleshooting, I would highly recommend to test it with Ubot4 first. To see if you have the same problems there.

V5 still has a lot of "challenges"

 

 

Dan

Edited by dan
Link to post
Share on other sites

Before you spend a lot of time troubleshooting, I would highly recommend to test it with Ubot4 first. To see if you have the same problems there.

V5 still has a lot of "challenges"

 

 

Dan

Thats a good way of putting it. I love Ubot and 5 is going to be really awesome when its... well you know. Just so the Ubot team knows, your doing a great job and we understand how difficult Ubot can be to make, so much stuff for the user to fuck up. :) So many combitnations of variables...

 

so chin up :)

 

and thanks :)

Link to post
Share on other sites

Found a work around, which incidentally works similar to the way "Element Child" should work I suppose.  Basically, I used the "Scrape Attribute" with scrapping "innerhtml".   I was originally using "innertext", which obviously didn't work for grabbing all the data I needed.

 

The below example throws it into a list. Ignore the exact "session_#", as I am working w/ many pages, but it is a quick fix to the problem above.

add list to list(%Temp List, $scrape attribute(<class="session_1008533106">, "innerhtml"), "Delete", "Global")

Thanks for your help Dan and Edward_2.

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