Last active
May 17, 2019 11:13
-
-
Save sairoopb/e362363581d0dc42ebfe93e13831ec97 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 | |
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