Jump to content
UBot Underground

Recommended Posts

Okay I've lost my mind.

 

How do you select an attachment for an email in the downloads folder that you don't know the exact path.

 

Example: mywickedfile-1923490834-.csv

 

 

This file changes it's tail name dynamically every time it's downloaded. 

 

 

I tried using a wildcard like mywickedfile*.csv but was not successful.

 

 

Cheers my friends and thanks in advance.

 

Jason Smith

Link to post
Share on other sites

Wildcard or regular expression is what you need.

 

For both ensure that you select the appropriate option in the advanced element editor, here are two examples, notice that the wildcard has a w and the regex has an r after the =

navigate("http://www.ubotstudio.com/resources","Wait")
set(#buttonWildcard,$scrape attribute(<id=w"upgrade_*_link_button">,"value"),"Global")
set(#buttonRegex,$scrape attribute(<value=r"Earn\\s[A-Z][a-z+]">,"value"),"Global")

Also be sure you're getting the right attribute in the first instance I select the element by the id attribute but scrape the value attribute, in the second both are value.

Link to post
Share on other sites
HelloInsomnia

 

I'm not getting a wildcard element on a specific page in the browser.

I'm using the email command in ubot to attach a file.

I'm looking in my downloads folder for a csv file with a date extension that I'm not sure of the exact name.

This will be the only csv file in this directory.

After I'm done attaching and sending it, I'm going to delete any csv file in this directory with a shell command.

 

Cheers and thanks in advance.

 

Jason Smith

Link to post
Share on other sites

This is one way to do it, there are others in regards to choosing file extensions or using regex in the file name only so if you need to be more specific let me know but in most cases this will work, change or set the #folder variable as well as what you want the filename to contain.

clear list(%files)
add list to list(%files,$get files(#folder,"Yes"),"Delete","Global")
loop($list total(%files)) {
    set(#file,$next list item(%files),"Global")
    if($contains(#file,"mywickedfile-")) {
        then {
            set(#fileToAtttach,#file,"Global")
        }
        else {
        }
    }
}
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...