Giter VIP home page Giter VIP logo

verzaukeksbrowsercontrol's Introduction

VerzaukeksBrowserControl

Control your browser within your code and get access to many useful features as if it were an add-on.

Download Firefox-Addon Here

Download Chrome-Addon Here (not available / unstable and buggy)

Firefox Popup Firefox Popup Dark

Kotlin Usage

Dependencies: gson

val browser = Browser()
browser.start() // browser.start(port)

val tab = browser.newTab("https://example.com") // newTab(url, active)
val currentTab = browser.getCurrentTab()
val tabs = browser.getTabs()

browser.onTabCreated { println("New tab was created: $it") }
browser.onTabUpdated { println("A tab was updated: $it") }


val result = tab.executeScript("console.log('hello'); 'result value';") // executeScript(script, expectAnswer)
tab.insertCSS("* { background: red }")

tab.clickElement("button") // clickElement(selector, waitTillFinished)
tab.inputText("input", "custom text here") // inputText(selector, value, waitTillFinished)

val element = tab.querySelector("h1")
val elements = tab.querySelectorAll("div")

tab.updateInfo()
tab.reload() // tab.reload(bypassCache)
tab.remove()


browser.stop() // stop(clearListeners)

Python Usage

from browser import Browser
from time import sleep

browser = Browser()
browser.start()  # browser.start(port)
browser.ping()

tab = browser.new_tab('https://example.com')  # new_tab(url, active)
current_tab = browser.get_current_tab()
tabs = browser.get_tabs()  # get_tabs(options)

browser.on_tab_created.append(lambda it: print(f'New tab was created: {it}'))
browser.on_tab_updated.append(lambda it: print(f'A tab was updated: {it}'))

result = tab.execute_script('console.log(\'hello\'); \'result value\';')  # execute_script(script, expect_answer)
tab.insert_css('* {background: red}')

tab.click_element('button')  # click_element(selector, wait_till_finished)
tab.input_text('input', 'custom text here')  # input_text(selector, value, wait_till_finished)

element = tab.query_selector('h1')
elements = tab.query_selector_all('div')

tab.update_info()
tab.reload()  # tab.reload(bypass_cache)
tab.remove()

sleep(1)
browser.stop()  # stop(clear_listeners)

verzaukeksbrowsercontrol's People

Contributors

verzaukeks avatar

Stargazers

Lars Krönner avatar Marvin avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.