Skip to content

Instantly share code, notes, and snippets.

@manuzhang
Last active July 23, 2019 13:42
Show Gist options
  • Save manuzhang/62134b2d3a89a7686d7dd7dd556a7834 to your computer and use it in GitHub Desktop.
Save manuzhang/62134b2d3a89a7686d7dd7dd556a7834 to your computer and use it in GitHub Desktop.
import $ivy.`org.seleniumhq.selenium:selenium-chrome-driver:3.0.1`
import org.openqa.selenium.JavascriptExecutor
import org.openqa.selenium.chrome.{ChromeDriver, ChromeOptions}
System.setProperty("webdriver.chrome.driver", "/Users/doriadong/bin/chromedriver")
val options = new ChromeOptions()
options.addArguments("--proxy-server=http://127.0.0.1:1087")
val driver = new ChromeDriver(options)
driver.get("https://overcast.fm/+E6UAAGfPU")
val jse = driver.asInstanceOf[JavascriptExecutor]
println(jse.executeScript(
"return document.getElementById('audioplayer').duration"))
driver.quit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment