Jump to content
UBot Underground

Can`t drag in link to create click command from load html


Recommended Posts

I need to click on links from an email but the problem is, the output of

asset://assets/ (in the UB browser) is like this:

 

Whatever the text is blahblahblah h ttp://whataver.com blahh blahhhh (had to add a space between H an T to unlink for this demonstration)

 

It`s all text only. I can`t drag in the link in the email to create a click command from load html asthere`s no link. It`s showing as text only.

 

set(#row, 0, "Global")
loop($table total rows(&emails)) {
    if($contains($table cell(&emails, #row, 0), "text i am looking for")) {
        then {
            load html("<html>
<body>
<p>

{$table cell(&emails, #row, 4)}
</p>
</body>
</html>")
        }
        else {
        }
    }
    increment(#row)
}

How can i work this out

Thanks

 

I forgot to add that it`s Gmail

 

EDITED`:

 

iS it because i`m getting text only version ? This only works if it`s html email versions ? If so, how can i grab the links in plain text version ? Thanks

 

EDITED 2:

 

Damn, that`s the case, it works fine when emails are html friendly but doesn`t work when it`s plain text.

Any ideas on a solution

Link to post
Share on other sites

I'm still struggling on finding out a way to grab links from plain text emails.

 

Anyone ?

Mommy, daddy ?

 

Lol....

 

First of all, can UB do this or i'm a bit too advanced ?

 

Man i'm sratching my head so much with this one. I tried so many things and nothing works !!!!

 

Thanks

Link to post
Share on other sites

Almost sorted:

 

(http|ftp|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&:/~\+#]*[\w\-\@?^=%&/~\+#])?

Looks like this works !! The thing is, it adds

amp; 

in the url and when i remove it,

(http|ftp|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&:/~\+#]*[\w\-\@?^=%&/~\+#])?

the url isn't complete (odd) ?

 

Also it grabs other urls which i don't need.

I need to find a way so it grabs only what i want

ex:

WHATEVERGOESHEREdomain.com/confirm.phpWHATEVERGOESHERE

and that

WHATEVERGOESHEREdomain.com/unconfirm.phpWHATEVERGOESHERE

is ignored

 

 

I'm getting there...

Link to post
Share on other sites

I have already built a REGEX to grab URLs in a different thread in REGEX TUTORIALS:

 

http://www.ubotstudio.com/forum/index.php?/topic/12459-regex-explained-match-extract-urls/&do=findComment&comment=67266

 

That should help you.

 

Good luck!

  • Like 1
Link to post
Share on other sites

What would i do whithout you hahahahahaha

 

If you ever get married or celebrate a divorce (lol) and you have a party, i'll play for you free of charge. Well just a couple of beers would do...

 

CHEERS

  • Like 1
Link to post
Share on other sites

Damn i'm so close to it !!

UB code works great, got the regex figured out but........

 

It grabs

amp;

which are added in the urls (it happens so often in email messages)

 

Ex:

clickme.asp?LID=1234&

but the damn

amp;

makes the url invalid when i navigate to it.

Of course, if i remove the bad added code amp; manually (where it adds it) url looks clean and it works fine.

 

Do you have a tip on how to remove the bloody

amp;

that are added everywhere in links on emails ?

 

Thanks a lot

 

Your reply should be sticky !!!!!!

Link to post
Share on other sites

6 + hours into this and i can't make it work.

 

The output always have amp; in the url when i navigate to it.

 

 

If i test my code at http://www.pagecolumn.com/tool/regtest.htm

Url comes out clean

 

I can't think straight now. Don't know what to try now

How do you guys manage to get ride of this ?????

Link to post
Share on other sites

Never played with this and never thought about it ! I'm missing lots of neat features from UB (the potential of the software)

 

Thanks, will have a look a this for sure !!!

 

 

Right now my regex can grab the exact url i wish in a plain text email (even if there's more than one http://whatever.com string)

It's also added to a list.

Now i need to know/understand, how to go into %thelist

then look for amp; (more than one)

and replace with $nothing

save (or else ?) then navigate to the new url without the damn amp; which corrupts everything.

 

This should be easy ?

 

Like i said, as i'm new to all of this and not a coder, i'm having a hard time thinking on how to proceed and steps to take to make it.

Plus, i don't know about all the things UB can perfom (add the language barrier too)

So things that looks pretty obvious for lots of people ain't obvious for me. I need a little kick in the a$$

 

I forgot that i'm getting old too, this doesn't help either hahahahahahahaha

 

Thanks again for your precious help !

Link to post
Share on other sites

You need to LOOP through the list, item after item and replace the unwanted characters with a $replace command, then add the newly created (edit) item at the end of the list and delete the old one, OR much simpler, just create a second list with the edited items with $add item to list inside the LOOP and when finished you can then simply delete (clear) the first list altogether...

  • Like 1
Link to post
Share on other sites

It looks like a mess HAHAHAHAHA

It ain't working at all. You will probably laugh at this one.

 

loop($list total(%regexurls)) {
    set(#nextlistitem, $next list item(%regexurls), "Global")
    set(#amp, $replace("amp;", "amp;", $nothing), "Global")
    add item to list(%regexurls2, #amp, "Delete", "Global")
    pause script
}

My scraped regex urls are into the list %regexurls

From then OMG lol....

 

EDITED:

Ohhhh i just saw that there's a $replace regular expression

Maybe i should do this to start with ? In fact, what is it ?

Link to post
Share on other sites

You will probably laugh at this one.

On the contrary, while you're totally missing the point there and the code is in fact doing nothing worth mentioning, YOUR EFFORTs are commendable.

 

Just think how one like ME would look/sound when trying to play the piano?

 

Back to the topic at hand... You are using a SET command that translates this way...

set(#amp, $replace("amp;", "amp;", $nothing), "Global")

... take the word/string "amp;" and replace within it the substring/word "amp;" (btw, it is exactly the whole string!) with an empty substring.

 

The result would be a substring from which the word "amp;" would be extracted.. but your initial string is the same word, so you end up with a big round nothing at all.. LOL

 

It doesn't matter anyway, because you are looping the list, while at the same time you are sending this poor string into oblivion time and time again... w/o affecting in any way the list items (which should be your goal)

 

What you have to do instead is this.

 

Loop the list.

 

Take each list item (in its whole) and assign it to a temporary string and only then, apply the logic you used above, thus removing the substring "amp;" from the end of each link (list item) <  makes sense?

 

Then, before going back to the loop's start for the next item, do something with this temp string... add it as an item to the new list (like you did) or other things... so that in the end, you will finish looping the first string and will get, at the same time a new list with the correct URLs

  • Like 1
Link to post
Share on other sites

Man i'm sooooooooooooo happy right now !!! You won't beleive the number of hours (probably close to 7) i spent on this !!! Thanks soooooooooo much !

Now it removes the damn amp; it was adding 3 times in the urls. I can now navigate to the urls and it's valid !!

I will post the code in case someone else runs into this problem and maybe someone else will clean it up as i think i got too much stuff in there.

 

Now i need a way to remove the confirmed email from my Gmail account. Last time i tried nothing worked. Emails couldn't get deleted

One step at a time....

 

Thanks again

Link to post
Share on other sites
loop($list total(%regexurls)) {
    set(#regex, $next list item(%regexurls), "Global")
    set(#amp, $replace($next list item(%regexurls), "amp;", $nothing), "Global")
    add item to list(%regexurls2, #amp, "Delete", "Global")
    navigate($next list item(%regexurls2), "Wait")
}

 

Link to post
Share on other sites

Your code is close, but not totally correct.

 

You see, the $next list item will not only return the item in the list at the current position, but at the SAME time it will advance the index to the next available position in the list.

 

Using $next list item multiple times inside a LOOP will give you errors.

 

Here is what happens in your code.

 

The first time you use $first list item, it retrieves say... first link in your list of scraped links and it places that item in a variable

  set(#regex, $next list item(%regexurls), "Global")

Which is excellent so far...

 

But guess what...

 

When you wrote the second node there:

set(#amp, $replace($next list item(%regexurls), "amp;", $nothing), "Global")

... you invoked $next list item again.. only this time it refers to the SECOND link in your list, because the index was already moved before.

 

Furthermore, once invoked, it retrieves the second list item, but again, it moves forward one position already... :P being now prep'd for the third list item.

 

The code above replaces "amp;" only on your second list item, not the first (which was passed over now)

 

Now, you correctly saved this replaced link to the new list, but then you NAVIGATE to it using $next list item once again... which being applied to another list though.. I honestly don't know what happens there... probably nothing yet, as it returns the saved item and moves forward to .. second list item that isn't even there yet?  Might give an error, not sure...

 

Anyway, the code above would work correctly if you start using $list item instead of $next list item and LOOP fixinf its value for each iteration with an INCREMENT

 

Hope this helps you understand the LOOPing better.

Link to post
Share on other sites

Ok i think i got it now

 

set(#position, 0, "Global")
loop($list total(%regexurls)) {
    set(#regex, $next list item(%regexurls), "Global")
    set(#amp, $replace($list item(%regexurls, #position), "amp;", $nothing), "Global")
    add item to list(%regexurls2, #amp, "Delete", "Global")
    navigate($list item(%regexurls2, #position), "Wait")
    wait($rand(20, 30))
    increment(#position)
}

Thanks MASTER (on my knees lol)

Now the "delete process" damn...

Link to post
Share on other sites

Now you got it... although, once you got rid of the $next list item in the other commands, I'm puzzled why you kept it on the first one?

 

The 'perfect' way to do it would be to call the list element with $list item in all your code.  Dump $next list item altogether...

 

Keep up the good work!  Kudos

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