Skip to content

Instantly share code, notes, and snippets.

@godwhoa
Forked from sairoopb/main.py
Last active May 17, 2019 11:18
Show Gist options
  • Save godwhoa/125160485aed6cae02737ba82dc4ae4e to your computer and use it in GitHub Desktop.
Save godwhoa/125160485aed6cae02737ba82dc4ae4e to your computer and use it in GitHub Desktop.
def get_html_array(js_url):
response = requests.get(js_url)
# Apply capture logic
start = response.text.find("var html = [") + len("var html = [") - 1 # this will get us the index of [
end = response.text.find(".join('\n')")
raw_js_array = response.text[start:end]
# really not sure whats going on down here..
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