Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

A Golang based Undetected Web Automation Framework

License

NotificationsYou must be signed in to change notification settings

bosniankicks/greenlight

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Greenlight is the first undetected Golang based Web-Automation Framework. Greenlight was made to create a way for Golang devs to utilize the lightweight code for fast automation browsing. With added error handling internally, the user can write their code just like playwright in python! No more err pain! Greenlight was named after the traffic light system. Greenlight, or go starts the browser initialization. YellowLight slows down the browser or does a wait/sleep function. Finally RedLight closes the browser and comes to a complete stop. Usage shown below :)

Installation

gogetgithub.com/bosniankicks/greenlightgomodtidy

Components

GreenLight(chromePathstring,headlessbool,startURLstring)InitializesChromebrowserinstanceArgs:-chromePath:PathtoChromeexecutable-headless:RunbrowserwithoutGUI-startURL:StartingURL-Returns:Browserinstance
RedLight()-Closesbrowserandcleansupresources
page.Goto(urlstring)-NavigatestospecifiedURL
page.YellowLight(millisecondsint)-Pausesexecutionforspecifiedmilliseconds (sameusageaswaitForTimeout)
page.Locator(selectorstring)-FindselementusingCSSselector-Returns:Locatorobject
locator.Fill(valuestring)-Clearsandfillsinputelement-Built-in30stimeout,retriesevery350ms
locator.Click()-Clickselement-Built-in30stimeout

Typing Functions (Added)

locator.TypeSequentially(textstring,delayMsint)-TypestextwithdelaybetweeneachcharacterArgs:text:StringtotypedelayMs:Milliseconddelaybetweenkeystrokes
locator.TypeWithMistakes(textstring,delayMsint)-Typeswithhuman-likemistakesandcorrections-RandomlyaddstyposandbackspacesArgs:text:StringtotypedelayMs:Basetypingspeed

Usage

package mainimport (    browser"github.com/bosniankicks/greenlight/pkg/browser")funcmain() {// Initialize browser - use your browser path wanted// keep headless as false for now (not enough testing)// if you want to force the browser to begin the automation at a URL right away,// it will auto open the url inside the greenlight func.// If you want a slower load visit google first or example.com then use goto.b:=browser.GreenLight("/Applications/Google Chrome.app/Contents/MacOS/Google Chrome",false,"https://example.com")deferb.RedLight()//either use this to auto close the browser or use b.RedLight() at the end of the script// Get page objectpage:=b.NewPage()// Navigate to URL wanted (use this as a reload or refresh of the same site if needed)page.Goto("https://login.example.com")// Fill form fields -- fills off locator input then can fill (paste) or type in different wayspage.Locator("#email").Fill("user@email.com")page.Locator("#password").TypeWithMistakes("password123",100)// Click submitpage.Locator("#submit").Click()// Wait 3 seconds -- 3 second delay or timeoutpage.YellowLight(3000)}

Contributing

Pull requests are welcome. Dm me on discord @pickumaternu if you have an idea thats realistic in automation. No I will not tell you how to make an akamai gen or recap gen or anything of a gen. Left out cookie saving this time on purpose.

The framework lacks functionality as you only really need to input things and click buttons in a framework. I didnt see the need to add some features like routes or whatever as this should be a basic framework against detection.

This does not work on CLOUDFLARE or any CAPTCHA, helps users bypass fingerprint anitbots such as Akamai, Kasada, DataDome, and others.

Checkout my previous work @https://github.com/bosniankicks/Kurva-Krome

Send me money as support for redbulls and geek bars -- cashapp -- $bosniankicks

License

MIT

Capsolver Sponsor

CapSolver Ads

Alternatively, you may use Capsolver. For more information and to get started, visit the officialCapsolver website.


[8]ページ先頭

©2009-2025 Movatter.jp