Понимая, что мне нужно использовать PyQt5 в сочетании с BeautifulSoup для запуска javascript на моем клиенте после извлечения HTML с помощью BeautifulSoup, я пытаюсь преобразовать переменную _Flourish_data в словарь Python.
Есть ли простой способ извлечь переменную Javascript _Flourish_data в словарь Python? Вот мой текущий Python для извлечения Javascript с помощью PyQt5 и BeautifulSoup:
function _Flourish_unflattenInto(dest, src) {
dest = dest || {};
for (var k in src) {
var t = dest;
for (var i = k.indexOf("."), p = 0; i >= 0; i = k.indexOf(".", p = i+1)) {
var s = k.substring(p, i);
if (!(s in t)) t[s] = {};
t = t[s];
}
t[k.substring(p)] = src[k];
}
return dest;
}
var _Flourish_settings = {"cell_fill_1":"#ffffff","cell_fill_2":"#ebebeb","cell_fill_direction":"horizontal","cell_font_size":"1","cell_height":20,"cell_horizontal_alignment":"center","cell_link_color":"#2886b2","cell_padding_horizontal":16,"cell_padding_vertical":11,"column_width_mode":"auto","column_widths":"10%, 10%, 10%, 10%, 50%, 10%","header_fill":"#181f6c","header_font_color":"#ffffff","header_font_default":false,"header_font_size":1.1,"header_horizontal_alignment":"center","header_style_default":true,"layout.body_font":{"name":"Source Sans Pro","url":"https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,700"},"layout.layout_order":"stack-default","layout.space_between_sections":"0.5","mobile.view":true,"no_results_text":"Use the search bar to find your state","pagination_amount":41,"pagination_amount_search":"5","search_enabled":false,"search_hide_table":false,"search_placeholder":"Search to find your state","search_resize":true,"search_width":15};
_Flourish_unflattenInto(window.template.state, _ F l o u r i s h _ s e t t i n g s ) ; < b r / > < b r / > v a r _ F l o u r i s h _ d a t a _ c o l u m n _ n a m e s = { & q u o t ; r o w s & q u o t ; : { & q u o t ; c o l u m n s & q u o t ; : [ & q u o t ; S t a t e & q u o t ; , & q u o t ; E a r l i e s t / P l a n n e d S t a r t D a t e f o r 2 0 / 2 1 A c a d e m i c Y e a r & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; ] } } , < b r / > _ F l o u r i s h _ d a t a = { & q u o t ; r o w s & q u o t ; : [ { & q u o t ; c o l u m n s & q u o t ; : [ & q u o t ; A l a b a m a & q u o t ; , & q u o t ; V a r i e s b y d i s t r i c t & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; ] } , { & q u o t ; c o l u m n s & q u o t ; : [ & q u o t ; A l a s k a & q u o t ; , & q u o t ; V a r i e s b y d i s t r i c t & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; ] } , { & q u o t ; c o l u m n s & q u o t ; : [ & q u o t ; A m e r i c a n S a m o a & q u o t ; , & q u o t ; U n k n o w n & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; ] } , { & q u o t ; c o l u m n s & q u o t ; : [ & q u o t ; A r i z o n a & q u o t ; , & q u o t ; V a r i e s b y d i s t r i c t & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; ] } , { & q u o t ; c o l u m n s & q u o t ; : [ & q u o t ; A r k a n s a s & q u o t ; , & q u o t ; V a r i e s b y d i s t r i c t & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; ] } , { & q u o t ; c o l u m n s & q u o t ; : [ & q u o t ; B u r e a u o f I n d i a n E d u c a t i o n & q u o t ; , & q u o t ; V a r i e s b y d i s t r i c t & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; ] } , { & q u o t ; c o l u m n s & q u o t ; : [ & q u o t ; C a l i f o r n i a & q u o t ; , & q u o t ; V a r i e s b y d i s t r i c t & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; ] } , { & q u o t ; c o l u m n s & q u o t ; : [ & q u o t ; C o l o r a d o & q u o t ; , & q u o t ; V a r i e s b y d i s t r i c t & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; ] } , { & q u o t ; c o l u m n s & q u o t ; : [ & q u o t ; C o n n e c t i c u t & q u o t ; , & q u o t ; N o t y e t d e t e r m i n e d & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; ] } , { & q u o t ; c o l u m n s & q u o t ; : [ & q u o t ; D e l a w a r e & q u o t ; , & q u o t ; V a r i e s b y d i s t r i c t & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; ] } , { & q u o t ; c o l u m n s & q u o t ; : [ & q u o t ; D e p a r t m e n t o f D e f e n s e E d u c a t i o n A c t i v i t y \ n & q u o t ; , & q u o t ; V a r i e s b y d i s t r i c t & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ;,"",""]},{"columns":["District of Columbia","8/31/2020","","","",""]},{"columns":["Florida","Unknown","","","",""]},{"columns":["Georgia","Unknown","","","",""]},{"columns":["Guam","Unknown","","","",""]},{"columns":["Hawaii","Not yet determined","","","",""]},{"columns":["Idaho","Varies by District","","","",""]},{"columns":["Illinois","Varies by district","","","",""]},{"columns":["Indiana","Not yet determined","","","",""]},{"columns":["Iowa","Varies by district","","","",""]},{"columns":["Kansas","Not yet determined","","","",""]},{"columns":["Kentucky","Unknown","","","",""]},{"columns":["Louisiana","Varies by district","","","",""]},{"columns":["Maine","Varies by district","","","",""]},{"columns":["Maryland","Not yet determined","","","",""]},{"columns":["Massachusetts","Not yet determined","","","",""]},{"columns":["Michigan","Not yet determined","","","",""]},{"columns":["Minnesota","Not yet determined","","","",""]},{"columns":["Mississippi ","Varies by district","","","",""]},{"columns":["Missouri","Varies by district","","","",""]},{"columns":["Montana","Varies by district","","","",""]},{"columns":["Nebraska","Varies by district","","","",""]},{"columns":["Nevada","Varies by district","","","",""]},{"columns":["New Hampshire","Not yet determined","","","",""]},{"columns":["New Jersey","Varies by district","","","",""]},{"columns":["New Mexico","Unknown","","","",""]},{"columns":["New York","Not yet determined","","","",""]},{"columns":["North Carolina","8/17/2020","","","",""]},{"columns":["North Dakota","Varies by district","","","",""]},{"columns":["Northern Marianas","Unknown","","","",""]},{"columns":["Ohio","Not yet determined","","","",""]},{"columns":["Oklahoma","Varies by district","","","",""]},{"columns":["Oregon","Not yet determined","","","",""]},{"columns":["Pennsylvania","Varies by district","","","",""]},{"columns":["Puerto Rico","Unknown","","","",""]},{"columns":["Rhode Island","Not yet determined","","","",""]},{"columns":["South Carolina","Not yet determined","","","",""]},{"columns":["South Dakota","Varies by district","","","",""]},{"columns":["Tennessee","Varies by district","","","",""]},{"columns":["Texas","Varies by district","","","",""]},{"columns":["U.S. Virgin Islands\n ","Not yet determined","","","",""]},{"columns":["Utah","Varies by district","","","",""]},{"columns":["Vermont","Not yet determined","","","",""]},{"columns":["Virginia","Not yet determined","","","",""]},{"columns":["Washington","Varies by District","","","",""]},{"columns":["West Virginia","Not yet determined","","","",""]},{"columns":["Wisconsin","Varies by district","","","",""]},{"columns":["Wyoming","Not yet determined","","","",""]}]};
for (var _Flourish_dataset in _Flourish_data) {
window.template.data[_Flourish_dataset] = _Flourish_data[_Flourish_dataset];
window.template.data[_Flourish_dataset].column_names = _Flourish_data_column_names[_Flourish_dataset];
}
window.template.draw();
Мне просто нужен var _flourish_data из HTML-тега, к а к п о к а з а н о н и ж е : < / p > < b r / > < c o d e > _ F l o u r i s h _ d a t a = { & q u o t ; r o w s & q u o t ; : [ { & q u o t ; c o l u m n s & q u o t ; : [ & q u o t ; A l a b a m a & q u o t ; , & q u o t ; V a r i e s b y d i s t r i c t & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; ] } , { & q u o t ; c o l u m n s & q u o t ; : [ & q u o t ; A l a s k a & q u o t ; , & q u o t ; V a r i e s b y d i s t r i c t & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; ] } , { & q u o t ; c o l u m n s & q u o t ; : [ & q u o t ; A m e r i c a n S a m o a & q u o t ; , & q u o t ; U n k n o w n & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; ] } , { & q u o t ; c o l u m n s & q u o t ; : [ & q u o t ; A r i z o n a & q u o t ; , & q u o t ; V a r i e s b y d i s t r i c t & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; ] } , { & q u o t ; c o l u m n s & q u o t ; : [ & q u o t ; A r k a n s a s & q u o t ; , & q u o t ; V a r i e s b y d i s t r i c t & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; ] } , { & q u o t ; c o l u m n s & q u o t ; : [ & q u o t ; B u r e a u o f I n d i a n E d u c a t i o n & q u o t ; , & q u o t ; V a r i e s b y d i s t r i c t & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; ] } , { & q u o t ; c o l u m n s & q u o t ; : [ & q u o t ; C a l i f o r n i a & q u o t ; , & q u o t ; V a r i e s b y d i s t r i c t & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; ] } , { & q u o t ; c o l u m n s & q u o t ; : [ & q u o t ; C o l o r a d o & q u o t ; , & q u o t ; V a r i e s b y d i s t r i c t & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; ] } , { & q u o t ; c o l u m n s & q u o t ; : [ & q u o t ; C o n n e c t i c u t & q u o t ; , & q u o t ; N o t y e t d e t e r m i n e d & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; ] } , { & q u o t ; c o l u m n s & q u o t ; : [ & q u o t ; D e l a w a r e & q u o t ; , & q u o t ; V a r i e s b y d i s t r i c t & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; ] } , { & q u o t ; c o l u m n s & q u o t ; : [ & q u o t ; D e p a r t m e n t o f D e f e n s e E d u c a t i o n A c t i v i t y \ n & q u o t ; , & q u o t ; V a r i e s b y d i s t r i c t & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ;,"",""]},{"columns":["District of Columbia","8/31/2020","","","",""]},{"columns":["Florida","Unknown","","","",""]},{"columns":["Georgia","Unknown","","","",""]},{"columns":["Guam","Unknown","","","",""]},{"columns":["Hawaii","Not yet determined","","","",""]},{"columns":["Idaho","Varies by District","","","",""]},{"columns":["Illinois","Varies by district","","","",""]},{"columns":["Indiana","Not yet determined","","","",""]},{"columns":["Iowa","Varies by district","","","",""]},{"columns":["Kansas","Not yet determined","","","",""]},{"columns":["Kentucky","Unknown","","","",""]},{"columns":["Louisiana","Varies by district","","","",""]},{"columns":["Maine","Varies by district","","","",""]},{"columns":["Maryland","Not yet determined","","","",""]},{"columns":["Massachusetts","Not yet determined","","","",""]},{"columns":["Michigan","Not yet determined","","","",""]},{"columns":["Minnesota","Not yet determined","","","",""]},{"columns":["Mississippi ","Varies by district","","","",""]},{"columns":["Missouri","Varies by district","","","",""]},{"columns":["Montana","Varies by district","","","",""]},{"columns":["Nebraska","Varies by district","","","",""]},{"columns":["Nevada","Varies by district","","","",""]},{"columns":["New Hampshire","Not yet determined","","","",""]},{"columns":["New Jersey","Varies by district","","","",""]},{"columns":["New Mexico","Unknown","","","",""]},{"columns":["New York","Not yet determined","","","",""]},{"columns":["North Carolina","8/17/2020","","","",""]},{"columns":["North Dakota","Varies by district","","","",""]},{"columns":["Northern Marianas","Unknown","","","",""]},{"columns":["Ohio","Not yet determined","","","",""]},{"columns":["Oklahoma","Varies by district","","","",""]},{"columns":["Oregon","Not yet determined","","","",""]},{"columns":["Pennsylvania","Varies by district","","","",""]},{"columns":["Puerto Rico","Unknown","","","",""]},{"columns":["Rhode Island","Not yet determined","","","",""]},{"columns":["South Carolina","Not yet determined","","","",""]},{"columns":["South Dakota","Varies by district","","","",""]},{"columns":["Tennessee","Varies by district","","","",""]},{"columns":["Texas","Varies by district","","","",""]},{"columns":["U.S. Virgin Islands\n ","Not yet determined","","","",""]},{"columns":["Utah","Varies by district","","","",""]},{"columns":["Vermont","Not yet determined","","","",""]},{"columns":["Virginia","Not yet determined","","","",""]},{"columns":["Washington","Varies by District","","","",""]},{"columns":["West Virginia","Not yet determined","","","",""]},{"columns":["Wisconsin","Varies by district","","","",""]},{"columns":["Wyoming","Not yet determined","","","",""]}]};
Понимая, что мне нужно использовать PyQt5 в сочетании с BeautifulSoup для запуска javascript на моем клиенте после извлечения HTML с помощью BeautifulSoup, я пытаюсь преобразовать переменную _Flourish_data в словарь Python. Есть ли простой способ извлечь переменную Javascript _Flourish_data в словарь Python? Вот мой текущий Python для извлечения Javascript с помощью PyQt5 и BeautifulSoup: [code]import bs4 as bs import sys import urllib.request from PyQt5.QtWebEngineWidgets import QWebEnginePage from PyQt5.QtWidgets import QApplication from PyQt5.QtCore import QUrl
page = Page('https://flo.uri.sh/visualisation/2451841/embed?auto=1') soup = bs.BeautifulSoup(page.html, 'html.parser') js_test = soup.find_all('script') js_test[5] [/code] Вывод существующего кода: [code] function _Flourish_unflattenInto(dest, src) { dest = dest || {}; for (var k in src) { var t = dest; for (var i = k.indexOf("."), p = 0; i >= 0; i = k.indexOf(".", p = i+1)) { var s = k.substring(p, i); if (!(s in t)) t[s] = {}; t = t[s]; } t[k.substring(p)] = src[k]; } return dest; } var _Flourish_settings = {"cell_fill_1":"#ffffff","cell_fill_2":"#ebebeb","cell_fill_direction":"horizontal","cell_font_size":"1","cell_height":20,"cell_horizontal_alignment":"center","cell_link_color":"#2886b2","cell_padding_horizontal":16,"cell_padding_vertical":11,"column_width_mode":"auto","column_widths":"10%, 10%, 10%, 10%, 50%, 10%","header_fill":"#181f6c","header_font_color":"#ffffff","header_font_default":false,"header_font_size":1.1,"header_horizontal_alignment":"center","header_style_default":true,"layout.body_font":{"name":"Source Sans Pro","url":"https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,700"},"layout.layout_order":"stack-default","layout.space_between_sections":"0.5","mobile.view":true,"no_results_text":"Use the search bar to find your state","pagination_amount":41,"pagination_amount_search":"5","search_enabled":false,"search_hide_table":false,"search_placeholder":"Search to find your state","search_resize":true,"search_width":15}; _Flourish_unflattenInto(window.template.state, _ F l o u r i s h _ s e t t i n g s ) ; < b r / > < b r / > v a r _ F l o u r i s h _ d a t a _ c o l u m n _ n a m e s = { & q u o t ; r o w s & q u o t ; : { & q u o t ; c o l u m n s & q u o t ; : [ & q u o t ; S t a t e & q u o t ; , & q u o t ; E a r l i e s t / P l a n n e d S t a r t D a t e f o r 2 0 / 2 1 A c a d e m i c Y e a r & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; ] } } , < b r / > _ F l o u r i s h _ d a t a = { & q u o t ; r o w s & q u o t ; : [ { & q u o t ; c o l u m n s & q u o t ; : [ & q u o t ; A l a b a m a & q u o t ; , & q u o t ; V a r i e s b y d i s t r i c t & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; ] } , { & q u o t ; c o l u m n s & q u o t ; : [ & q u o t ; A l a s k a & q u o t ; , & q u o t ; V a r i e s b y d i s t r i c t & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; ] } , { & q u o t ; c o l u m n s & q u o t ; : [ & q u o t ; A m e r i c a n S a m o a & q u o t ; , & q u o t ; U n k n o w n & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; ] } , { & q u o t ; c o l u m n s & q u o t ; : [ & q u o t ; A r i z o n a & q u o t ; , & q u o t ; V a r i e s b y d i s t r i c t & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; ] } , { & q u o t ; c o l u m n s & q u o t ; : [ & q u o t ; A r k a n s a s & q u o t ; , & q u o t ; V a r i e s b y d i s t r i c t & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; ] } , { & q u o t ; c o l u m n s & q u o t ; : [ & q u o t ; B u r e a u o f I n d i a n E d u c a t i o n & q u o t ; , & q u o t ; V a r i e s b y d i s t r i c t & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; ] } , { & q u o t ; c o l u m n s & q u o t ; : [ & q u o t ; C a l i f o r n i a & q u o t ; , & q u o t ; V a r i e s b y d i s t r i c t & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; ] } , { & q u o t ; c o l u m n s & q u o t ; : [ & q u o t ; C o l o r a d o & q u o t ; , & q u o t ; V a r i e s b y d i s t r i c t & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; ] } , { & q u o t ; c o l u m n s & q u o t ; : [ & q u o t ; C o n n e c t i c u t & q u o t ; , & q u o t ; N o t y e t d e t e r m i n e d & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; ] } , { & q u o t ; c o l u m n s & q u o t ; : [ & q u o t ; D e l a w a r e & q u o t ; , & q u o t ; V a r i e s b y d i s t r i c t & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; ] } , { & q u o t ; c o l u m n s & q u o t ; : [ & q u o t ; D e p a r t m e n t o f D e f e n s e E d u c a t i o n A c t i v i t y \ n & q u o t ; , & q u o t ; V a r i e s b y d i s t r i c t & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ;,"",""]},{"columns":["District of Columbia","8/31/2020","","","",""]},{"columns":["Florida","Unknown","","","",""]},{"columns":["Georgia","Unknown","","","",""]},{"columns":["Guam","Unknown","","","",""]},{"columns":["Hawaii","Not yet determined","","","",""]},{"columns":["Idaho","Varies by District","","","",""]},{"columns":["Illinois","Varies by district","","","",""]},{"columns":["Indiana","Not yet determined","","","",""]},{"columns":["Iowa","Varies by district","","","",""]},{"columns":["Kansas","Not yet determined","","","",""]},{"columns":["Kentucky","Unknown","","","",""]},{"columns":["Louisiana","Varies by district","","","",""]},{"columns":["Maine","Varies by district","","","",""]},{"columns":["Maryland","Not yet determined","","","",""]},{"columns":["Massachusetts","Not yet determined","","","",""]},{"columns":["Michigan","Not yet determined","","","",""]},{"columns":["Minnesota","Not yet determined","","","",""]},{"columns":["Mississippi ","Varies by district","","","",""]},{"columns":["Missouri","Varies by district","","","",""]},{"columns":["Montana","Varies by district","","","",""]},{"columns":["Nebraska","Varies by district","","","",""]},{"columns":["Nevada","Varies by district","","","",""]},{"columns":["New Hampshire","Not yet determined","","","",""]},{"columns":["New Jersey","Varies by district","","","",""]},{"columns":["New Mexico","Unknown","","","",""]},{"columns":["New York","Not yet determined","","","",""]},{"columns":["North Carolina","8/17/2020","","","",""]},{"columns":["North Dakota","Varies by district","","","",""]},{"columns":["Northern Marianas","Unknown","","","",""]},{"columns":["Ohio","Not yet determined","","","",""]},{"columns":["Oklahoma","Varies by district","","","",""]},{"columns":["Oregon","Not yet determined","","","",""]},{"columns":["Pennsylvania","Varies by district","","","",""]},{"columns":["Puerto Rico","Unknown","","","",""]},{"columns":["Rhode Island","Not yet determined","","","",""]},{"columns":["South Carolina","Not yet determined","","","",""]},{"columns":["South Dakota","Varies by district","","","",""]},{"columns":["Tennessee","Varies by district","","","",""]},{"columns":["Texas","Varies by district","","","",""]},{"columns":["U.S. Virgin Islands\n ","Not yet determined","","","",""]},{"columns":["Utah","Varies by district","","","",""]},{"columns":["Vermont","Not yet determined","","","",""]},{"columns":["Virginia","Not yet determined","","","",""]},{"columns":["Washington","Varies by District","","","",""]},{"columns":["West Virginia","Not yet determined","","","",""]},{"columns":["Wisconsin","Varies by district","","","",""]},{"columns":["Wyoming","Not yet determined","","","",""]}]}; for (var _Flourish_dataset in _Flourish_data) { window.template.data[_Flourish_dataset] = _Flourish_data[_Flourish_dataset]; window.template.data[_Flourish_dataset].column_names = _Flourish_data_column_names[_Flourish_dataset]; } window.template.draw();
[/code] Мне просто нужен var _flourish_data из HTML-тега, к а к п о к а з а н о н и ж е : < / p > < b r / > < c o d e > _ F l o u r i s h _ d a t a = { & q u o t ; r o w s & q u o t ; : [ { & q u o t ; c o l u m n s & q u o t ; : [ & q u o t ; A l a b a m a & q u o t ; , & q u o t ; V a r i e s b y d i s t r i c t & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; ] } , { & q u o t ; c o l u m n s & q u o t ; : [ & q u o t ; A l a s k a & q u o t ; , & q u o t ; V a r i e s b y d i s t r i c t & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; ] } , { & q u o t ; c o l u m n s & q u o t ; : [ & q u o t ; A m e r i c a n S a m o a & q u o t ; , & q u o t ; U n k n o w n & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; ] } , { & q u o t ; c o l u m n s & q u o t ; : [ & q u o t ; A r i z o n a & q u o t ; , & q u o t ; V a r i e s b y d i s t r i c t & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; ] } , { & q u o t ; c o l u m n s & q u o t ; : [ & q u o t ; A r k a n s a s & q u o t ; , & q u o t ; V a r i e s b y d i s t r i c t & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; ] } , { & q u o t ; c o l u m n s & q u o t ; : [ & q u o t ; B u r e a u o f I n d i a n E d u c a t i o n & q u o t ; , & q u o t ; V a r i e s b y d i s t r i c t & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; ] } , { & q u o t ; c o l u m n s & q u o t ; : [ & q u o t ; C a l i f o r n i a & q u o t ; , & q u o t ; V a r i e s b y d i s t r i c t & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; ] } , { & q u o t ; c o l u m n s & q u o t ; : [ & q u o t ; C o l o r a d o & q u o t ; , & q u o t ; V a r i e s b y d i s t r i c t & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; ] } , { & q u o t ; c o l u m n s & q u o t ; : [ & q u o t ; C o n n e c t i c u t & q u o t ; , & q u o t ; N o t y e t d e t e r m i n e d & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; ] } , { & q u o t ; c o l u m n s & q u o t ; : [ & q u o t ; D e l a w a r e & q u o t ; , & q u o t ; V a r i e s b y d i s t r i c t & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ; ] } , { & q u o t ; c o l u m n s & q u o t ; : [ & q u o t ; D e p a r t m e n t o f D e f e n s e E d u c a t i o n A c t i v i t y \ n & q u o t ; , & q u o t ; V a r i e s b y d i s t r i c t & q u o t ; , & q u o t ; & q u o t ; , & q u o t ; & q u o t ;,"",""]},{"columns":["District of Columbia","8/31/2020","","","",""]},{"columns":["Florida","Unknown","","","",""]},{"columns":["Georgia","Unknown","","","",""]},{"columns":["Guam","Unknown","","","",""]},{"columns":["Hawaii","Not yet determined","","","",""]},{"columns":["Idaho","Varies by District","","","",""]},{"columns":["Illinois","Varies by district","","","",""]},{"columns":["Indiana","Not yet determined","","","",""]},{"columns":["Iowa","Varies by district","","","",""]},{"columns":["Kansas","Not yet determined","","","",""]},{"columns":["Kentucky","Unknown","","","",""]},{"columns":["Louisiana","Varies by district","","","",""]},{"columns":["Maine","Varies by district","","","",""]},{"columns":["Maryland","Not yet determined","","","",""]},{"columns":["Massachusetts","Not yet determined","","","",""]},{"columns":["Michigan","Not yet determined","","","",""]},{"columns":["Minnesota","Not yet determined","","","",""]},{"columns":["Mississippi ","Varies by district","","","",""]},{"columns":["Missouri","Varies by district","","","",""]},{"columns":["Montana","Varies by district","","","",""]},{"columns":["Nebraska","Varies by district","","","",""]},{"columns":["Nevada","Varies by district","","","",""]},{"columns":["New Hampshire","Not yet determined","","","",""]},{"columns":["New Jersey","Varies by district","","","",""]},{"columns":["New Mexico","Unknown","","","",""]},{"columns":["New York","Not yet determined","","","",""]},{"columns":["North Carolina","8/17/2020","","","",""]},{"columns":["North Dakota","Varies by district","","","",""]},{"columns":["Northern Marianas","Unknown","","","",""]},{"columns":["Ohio","Not yet determined","","","",""]},{"columns":["Oklahoma","Varies by district","","","",""]},{"columns":["Oregon","Not yet determined","","","",""]},{"columns":["Pennsylvania","Varies by district","","","",""]},{"columns":["Puerto Rico","Unknown","","","",""]},{"columns":["Rhode Island","Not yet determined","","","",""]},{"columns":["South Carolina","Not yet determined","","","",""]},{"columns":["South Dakota","Varies by district","","","",""]},{"columns":["Tennessee","Varies by district","","","",""]},{"columns":["Texas","Varies by district","","","",""]},{"columns":["U.S. Virgin Islands\n ","Not yet determined","","","",""]},{"columns":["Utah","Varies by district","","","",""]},{"columns":["Vermont","Not yet determined","","","",""]},{"columns":["Virginia","Not yet determined","","","",""]},{"columns":["Washington","Varies by District","","","",""]},{"columns":["West Virginia","Not yet determined","","","",""]},{"columns":["Wisconsin","Varies by district","","","",""]},{"columns":["Wyoming","Not yet determined","","","",""]}]};