Skip to content

Instantly share code, notes, and snippets.

@sairoopb
Last active May 17, 2019 11:13
Show Gist options
  • Save sairoopb/e362363581d0dc42ebfe93e13831ec97 to your computer and use it in GitHub Desktop.
Save sairoopb/e362363581d0dc42ebfe93e13831ec97 to your computer and use it in GitHub Desktop.
def get_html_array(js_url):
response = requests.get(js_url)
# Apply capture logic
raw_js_array = response.text # Apply your capture logic; note raw_js_array is a string
result = raw_js_array.find("var html = ")
end = raw_js_array.find(".join('\n')")
json_file = []
for data in range(result+12,end-1):
json_file.append(data)
python_list = json.loads(json_file) # use a proper variable names
# return python_list
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment