Skip to content

Instantly share code, notes, and snippets.

@seleniumgists
Created June 13, 2019 08:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save seleniumgists/582dc16c69129a30e8c315a14d6e0759 to your computer and use it in GitHub Desktop.
Save seleniumgists/582dc16c69129a30e8c315a14d6e0759 to your computer and use it in GitHub Desktop.
generated automatically from #selenium on seleniumhq slack
<script type="application/ld+json">
{"name":"Pure Gym","addressLocality":"Woolwich","telephone":"0123456789"}
</script>
scripts = driver.find_elements(:tag_name, "script")
script = scripts[17].attribute('innerHTML')
parsed_json = JSON.parse(script)
puts parsed_json['telephone']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment