-
-
Save godwhoa/125160485aed6cae02737ba82dc4ae4e to your computer and use it in GitHub Desktop.
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
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