Created
June 13, 2019 08:37
-
-
Save seleniumgists/582dc16c69129a30e8c315a14d6e0759 to your computer and use it in GitHub Desktop.
generated automatically from #selenium on seleniumhq slack
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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