Created
January 7, 2015 10:28
-
-
Save skatkov/4ab15b93d4924200c5d9 to your computer and use it in GitHub Desktop.
testing revolution :)
This file contains hidden or 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
import requests | |
def visit(d): | |
print "Visit: %s" % d.url | |
if 'follow' in d.json(): | |
visit(requests.get(next_link(d))) | |
else: | |
print d.text | |
def next_link(d): | |
follow_link = d.json().get('follow') | |
return "http://www.letsrevolutionizetesting.com/challenge.json?id=" + follow_link.split("=")[-1] | |
if __name__ == "__main__": | |
url = "http://www.letsrevolutionizetesting.com/challenge.json" | |
visit(requests.get(url)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment