This repository was archived by the owner on Sep 17, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Examples
waxnet edited this page May 18, 2025
·
16 revisions
-- setup
SetScriptTitle("Website Image Scraper")
-- functions
local function CheckTableForValue(t, v)
for _, value in pairs(t) do
if value == v then
return true
end
end
return false
end
-- main
local function main()
-- start
local targetUrl = Input("Enter the website url to scrape : ", "DarkYellow")
-- data
local urls = {
jpeg = {},
webp = {},
png = {},
svg = {}
}
-- start driver
Print("\nStarting driver . . .", "DarkGray")
local driver = StartDriver("chrome", 450, 600)
local network = driver.Network
-- hook network responses
Print("Hooking network responses . . .", "DarkGray")
local connection = network:Connect(function(data)
-- check resource type
if data.ResourceType ~= "Image" then return end
-- check content type and add to table
local contentType = data.Headers["content-type"]:gsub("image/", ""):lower()
local urlFileExtension = data.Url:match("%.([^.]+)$"):lower()
local urlTableCT = urls[contentType]
local urlTableUFE = urls[urlFileExtension]
if urlTableCT == nil and urlTableUFE == nil then
return
end
local urlTable = ((urlTableCT ~= nil) and urlTableCT or urlTableUFE)
if not CheckTableForValue(urlTable, data.Url) then
table.insert(urlTable, data.Url)
end
end, "responses")
-- go to url
Print("Opening website . . .", "DarkGray")
driver:Browse(targetUrl)
-- start scraping
Input("Press enter to start scraping . . .", "DarkYellow")
network:StartMonitoring()
-- stop scraping
Input("Press enter to stop scraping . . .", "DarkYellow")
network:StopMonitoring()
network:Disconnect(connection)
driver:Quit()
-- setup folders
Print("Setting up folders . . .", "DarkGray")
if DoesFolderExist("WebsiteImageScraper") then
DeleteFolder("WebsiteImageScraper")
end
CreateFolder("WebsiteImageScraper")
for urlKey, _ in pairs(urls) do
CreateFolder("WebsiteImageScraper/"..urlKey)
end
-- download images
Print("Downloading images . . .", "DarkGray")
local counter = 0
for urlKey, urlTable in pairs(urls) do
for _, url in pairs(urlTable) do
DownloadFile(
url,
"WebsiteImageScraper/"..urlKey.."/"..tostring(counter).."."..urlKey
)
counter = (counter + 1)
end
counter = 0
end
-- finish
Print("Done!", "Green")
Print("\nCheck the folder \"WebsiteImageScraper\" to see the downloaded images.", "DarkGray")
end
-- init
main()-- setup script
SetScriptTitle("Outlook Account Generator")
-- main function
local function main()
-- ask for amount of accounts to generate
local accountsToGenerate = tonumber(Input("How many accounts do you want to generate? : ", "DarkYellow"))
-- setup
if not DoesFolderExist("OutlookGen") then
CreateFolder("OutlookGen")
end
if not DoesFileExist("OutlookGen/accounts.txt") then
WriteToFile("OutlookGen/accounts.txt", "OutlookGen Accounts")
end
-- init driver
local driver = StartDriver("firefox", 450, 600)
Print("\nStarting driver . . .", "DarkGray")
-- go to signup page
Print("\nOpening signup page . . .", "DarkGray")
driver:Browse("https://account.microsoft.com/account?lang=en-en")
-- generate
for _ = 1, accountsToGenerate do
-- click create account
driver:WaitForElement(30, "id__11"):Click()
-- username
Print("Compiling email . . .", "DarkGray")
local randomWord = SendGetRequest("https://random-word-api.herokuapp.com/word"):gsub('[%[%]"]', '')
local randomNumber = tostring(GetRandomNumber(1000, 9999))
local username = randomWord..randomNumber.."@outlook.com"
local usernameBox = driver:WaitForElement(30, "floatingLabelInput5")
usernameBox.Text = username
driver:FindElement('[data-testid="primaryButton"]', "CssSelector"):Click()
-- password
Print("Compiling password . . .", "DarkGray")
local password = GetRandomString(15)
local passwordBox = driver:WaitForElement(999, '[type="password"]', "CssSelector")
passwordBox.Text = password
driver:FindElement('[data-testid="primaryButton"]', "CssSelector"):Click()
-- country and birthdate
Print("Compiling country and birthdate . . .", "DarkGray")
local countryBox = driver:WaitForElement(999, "selectDropdown19")
local birthDayBox = driver:WaitForElement(999, "selectDropdown22")
local birthMonthBox = driver:WaitForElement(999, "selectDropdown21")
local birthYearBox = driver:WaitForElement(999, "floatingLabelInput23")
countryBox.Text = "United States"
birthDayBox.Text = tostring(GetRandomNumber(1, 20))
birthMonthBox.Text = "June"
birthYearBox.Text = tostring(GetRandomNumber(2000, 2006))
driver:FindElement('[data-testid="primaryButton"]', "CssSelector"):Click()
-- first and last name
local firstNameBox = driver:WaitForElement(999, "firstNameInput")
local lastNameBox = driver:WaitForElement(999, "lastNameInput")
firstNameBox.Text = randomWord
lastNameBox.Text = randomNumber
driver:FindElement("marketingOptIn"):Click()
driver:FindElement('[data-testid="primaryButton"]', "CssSelector"):Click()
-- check for bot verification
local botVerificationPage = driver:WaitForElement(5, "enforcementFrame")
if botVerificationPage ~= nil then
Print("Bot verification detected, complete to continue . . .", "Red")
repeat Wait(.5) until driver:FindElement("enforcementFrame") == nil
end
-- set preferences
Print("Setting preferences . . .", "DarkGray")
local okButton = driver:WaitForElement(999, "id__0")
okButton:Click()
Wait(1)
okButton:Click()
driver:WaitForElement(30, '[data-testid="secondaryButton"]', "CssSelector"):Click()
-- log out
local profile = driver:WaitForElement(30, "O365_MainLink_Me")
Wait(2)
profile:Click()
local signOut = driver:WaitForElement(30, "mectrl_body_signOut")
signOut:Click()
-- save account
Print("Saving account . . .", "DarkGray")
AppendToFile(
"OutlookGen/accounts.txt",
"\n\nUsername : " .. username ..
"\nPassword : " .. password
)
-- status
Print("Account generated!\n", "DarkGreen")
end
-- quit driver
Print("Quitting driver . . .", "DarkGray")
driver:Quit()
end
-- start
main()
-- final
Print("\nDone!", "Green")Happy Scripting!