No description
Find a file
Bung 3293bd67fc Update service.nim
export isConnectable
2024-04-09 06:30:04 -06:00
.github/workflows ci 2024-01-11 07:26:05 -07:00
examples Update code to work with latest Nim and uuids 2023-12-14 21:20:12 -07:00
src Update service.nim 2024-04-09 06:30:04 -06:00
tests Initial service implementation 2020-02-23 21:07:30 -07:00
.gitignore Update code to work with latest Nim and uuids 2023-12-14 21:20:12 -07:00
halonium.nimble use zippy. no bin 2024-01-11 07:26:05 -07:00
LICENSE Initial commit 2020-02-21 11:10:18 -07:00
README.md Update code to work with latest Nim and uuids 2023-12-14 21:20:12 -07:00

halonium

A browser automation engine written in Nim translated from Python.

Status

This library is mostly converted from the Python selenium codebase as of ~Dec 2019. There are no automated tests yet, but most webdrivers are working from basic testing (see src/halonium/browser.nim for supported browsers). Some things might not work yet which automated testing would catch. Feel free to file issues :)

Usage

See examples for detailed usage.

import options, os
import halonium

proc main() =
  var session = createSession(Chrome)
  session.navigate("https://google.com")

  let searchBar = "input[title=\"Search\"]"
  let element = session.waitForElement(searchBar).get()

  element.sendKeys("clowns", Key.Enter)

  let firstATag = session.waitForElement("#search a").get()
  firstATag.click()
  sleep(1000)

  session.stop()

main()