<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Help with puppeteer ,cheerio and json]]></title><description><![CDATA[<p dir="auto">Can someone please help me solve noob problems with the development of my module.<br />
The module collects data from <a href="http://www.ri-info.net/Radovi.aspx" target="_blank" rel="noopener noreferrer nofollow ugc">http://www.ri-info.net/Radovi.aspx</a> of possible works and shutdowns of water and electricity installations, by streets and places for the area of ​​the city of Rijeka, Croatia.<br />
The module works, but I need to implement a few more things to be more complete. And the DOM must be rewritten.<br />
The data on the website is generated dynamically, so I use puppeteer and cheerio to retrieve the data and pack it in JSON.</p>
<p dir="auto"><strong>The first problem and doubts:</strong><br />
The plan was to use website search  to match the street and location added to the config.</p>
<p dir="auto">sample in configuration:</p>
<pre><code>{
module: "MMM-Radovi-RI",
position: "top_right",
	config: {
		streetName:"Labinska",
		placeName:"Rijeka"
		}
},
</code></pre>
<p dir="auto">I manage to pass config.streetName and config.placeName to node_helper, puppeteer find, but for some streets there is a multi-street selector.<br />
I don’t know how to automatically implement street and place marker combinations. This should look like this</p>
<pre><code>"LABINSKA, Rijeka"
</code></pre>
<p dir="auto">The selector is working with manualy typed  :</p>
<pre><code>	const option = (await page.$x(
            '//*[@id="cphContent_cphSadrzaj_ddlOdaberiUlicu"]/option[text() = "LABINSKA, Rijeka"]'   
// text "LABINSKA, Rijeka" shoul be combine from payload (config.streetName:"",config.placeName:"",)
          ))[0];
          const value = await (await option.getProperty('value')).jsonValue();
         await page.select('#cphContent_cphSadrzaj_ddlOdaberiUlicu', value);
	
	}catch (error) {
        console.log("The element didn't appear.")
    }
</code></pre>
<p dir="auto">The big problem is the website search engine for some street  is not working properly (data is not displayed), but if I select everything, then there is street and job data.<br />
Maybe I should ignore <strong>first problem</strong> and collect all the data in JSON and then sort and display it using config selection.</p>
<p dir="auto"><strong>Second problem:</strong><br />
Because table is generated automatically i have problem collecting all data.<br />
I’m using <em><strong>tr class=“tableRow”</strong></em> as reference to get data as place ,street, starting time ,end time and end date of work (interruption).<br />
I don’t know how to get <em><strong>tr class:“datum”</strong></em> as starting point of first day and add all rest data in that.</p>
<p dir="auto"><em>code is still in progress</em></p>
<pre><code>	const $ = cheerio.load(html);
    var water = [];
    var waterList = [];
    var el = $('#cphContent_cphSadrzaj_upVoda table tbody ')[0];
    if (el) {
        $('#cphContent_cphSadrzaj_upVoda table tbody .tableRow').prev().each(function (index, elem) {
            const $elem = $(elem);
            var street = $elem.find('span[id*="Label2"]').text();
            var streetNmbr = $elem.find('span[id*="Label7"]').text();
            var startTime = $elem.find('span[id*="Label8"]').text();
            var endTime = $elem.find('span[id*="Label9"]').text();
            var endWork = $elem.find('span[id*="Label10"]').text();

            var water = {
                street,
                streetNmbr,
                startTime,
                endTime,
                endWork
            };
            waterList.push(water);

        });

    };
    if (!el) {
        console.log('No new entries!');
    };
    var waterWork = JSON.parse(JSON.stringify(waterList));
   
	self.sendSocketNotification('ELECTRIC_POWER_DISCONNECTED', waterWork);
</code></pre>
<p dir="auto">table sample from html</p>
<pre><code>&lt;tr class="tableRow"&gt;
                                                &lt;/tr&gt;&lt;table id="radovi" class="tabla"&gt;
                                        &lt;tbody&gt;&lt;tr&gt;
                                            &lt;th&gt;&lt;/th&gt;
                                            &lt;th class="ulica"&gt;Ulica
                                            &lt;/th&gt;
                                            &lt;th class="kucnibroj"&gt;Kućni broj
                                            &lt;/th&gt;
                                            &lt;th&gt;od
                                            &lt;/th&gt;
                                            &lt;th&gt;do
                                            &lt;/th&gt;
                                            &lt;th&gt;Povremeno
                                            &lt;/th&gt;
                                            &lt;th&gt;Kraj
                                            &lt;/th&gt;
                                        &lt;/tr&gt;
                                        
                                    &lt;tr class="datum"&gt;
                                        &lt;th&gt;
                                            &lt;div style="font-size: 11px;"&gt;
                                                08.12.2020   //this date to use as starting date and make array for object
                                            &lt;/div&gt;
                                        &lt;/th&gt;
                                    &lt;/tr&gt;
                                    
                                            
                                            &lt;tr&gt;
                                                &lt;td&gt;
                                                    &lt;a id="cphContent_cphSadrzaj_lvVoda_ListView1_0_LinkButton1_0" title="Dodatne informacije" href="javascript:__doPostBack('ctl00$ctl00$cphContent$cphSadrzaj$lvVoda$ctrl0$ListView1$ctrl0$LinkButton1','')"&gt;&lt;img id="cphContent_cphSadrzaj_lvVoda_ListView1_0_Image1_0" src="resources/images/plus.png" style="height:16px;"&gt;&lt;/a&gt;
                                                    
                                                &lt;/td&gt;
                                                &lt;td class="ulica"&gt;
                                                    &lt;span id="cphContent_cphSadrzaj_lvVoda_ListView1_0_Label2_0" style="color:Black;"&gt;DOVIČIĆI, Viškovo&lt;/span&gt;
                                                &lt;/td&gt;
                                                &lt;td class="kucnibroj"&gt;    
                                                    &lt;span id="cphContent_cphSadrzaj_lvVoda_ListView1_0_Label7_0" style="color:Black;"&gt;19-20 ; 39-42 &lt;/span&gt;
                                                &lt;/td&gt;
                                                &lt;td&gt;
                                                    &lt;span id="cphContent_cphSadrzaj_lvVoda_ListView1_0_Label8_0" style="color:Black;"&gt;08:30&lt;/span&gt;
                                                &lt;/td&gt;
                                                &lt;td&gt;
                                                    &lt;span id="cphContent_cphSadrzaj_lvVoda_ListView1_0_Label9_0" style="color:Black;"&gt;14:30&lt;/span&gt;
                                                &lt;/td&gt;
                                                &lt;td&gt;
                                                    &lt;span class="aspNetDisabled"&gt;&lt;input id="cphContent_cphSadrzaj_lvVoda_ListView1_0_CheckBox1_0" type="checkbox" name="ctl00$ctl00$cphContent$cphSadrzaj$lvVoda$ctrl0$ListView1$ctrl0$CheckBox1" disabled="disabled"&gt;&lt;/span&gt;
                                                &lt;/td&gt;
                                                &lt;td&gt;
                                                    &lt;span id="cphContent_cphSadrzaj_lvVoda_ListView1_0_Label10_0" style="color:Black;"&gt;08.12.20&lt;/span&gt;
                                                &lt;/td&gt;
                                                &lt;/tr&gt;&lt;tr class="tableRow"&gt;
                                                &lt;/tr&gt;
                                            
                                            &lt;tr&gt;
                                                &lt;td class="tableNapomena" colspan="6"&gt;
                                                    &lt;div id="" style="border: 0px; margin: 0px; padding: 0px; overflow-y: hidden; visibility: visible; height: 0px; display: none;" class=""&gt;&lt;div id="cphContent_cphSadrzaj_lvVoda_ListView1_0_ManagingPanel_0" style="visibility: visible; height: auto;"&gt;
		
                                                        Navedenim područjem kružiti će autocisterna
                                                    
	&lt;/div&gt;&lt;/div&gt;
                                                    &lt;input type="hidden" name="ctl00$ctl00$cphContent$cphSadrzaj$lvVoda$ctrl0$ListView1$ctrl0$CollapsiblePanelExtender1_ClientState" id="cphContent_cphSadrzaj_lvVoda_ListView1_0_CollapsiblePanelExtender1_ClientState_0" value="true"&gt;
                                                &lt;/td&gt;
                                            &lt;/tr&gt;
                                        
                                            &lt;tr&gt;
                                                &lt;td&gt;
                                                    &lt;a id="cphContent_cphSadrzaj_lvVoda_ListView1_0_LinkButton1_1" title="Dodatne informacije" href="javascript:__doPostBack('ctl00$ctl00$cphContent$cphSadrzaj$lvVoda$ctrl0$ListView1$ctrl1$LinkButton1','')"&gt;&lt;img id="cphContent_cphSadrzaj_lvVoda_ListView1_0_Image1_1" src="resources/images/plus.png" style="height:16px;"&gt;&lt;/a&gt;
                                                    
                                                &lt;/td&gt;
                                                &lt;td class="ulica"&gt;
                                                    &lt;span id="cphContent_cphSadrzaj_lvVoda_ListView1_0_Label2_1" style="color:Black;"&gt;FERENCI, Viškovo&lt;/span&gt;
                                                &lt;/td&gt;
                                                &lt;td class="kucnibroj"&gt;
                                                    &lt;span id="cphContent_cphSadrzaj_lvVoda_ListView1_0_Label7_1" style="color:Black;"&gt;9-55&lt;/span&gt;
                                                &lt;/td&gt;
                                                &lt;td&gt;
                                                    &lt;span id="cphContent_cphSadrzaj_lvVoda_ListView1_0_Label8_1" style="color:Black;"&gt;08:30&lt;/span&gt;
                                                &lt;/td&gt;
                                                &lt;td&gt;
                                                    &lt;span id="cphContent_cphSadrzaj_lvVoda_ListView1_0_Label9_1" style="color:Black;"&gt;14:30&lt;/span&gt;
                                                &lt;/td&gt;
                                                &lt;td&gt;
                                                    &lt;span class="aspNetDisabled"&gt;&lt;input id="cphContent_cphSadrzaj_lvVoda_ListView1_0_CheckBox1_1" type="checkbox" name="ctl00$ctl00$cphContent$cphSadrzaj$lvVoda$ctrl0$ListView1$ctrl1$CheckBox1" disabled="disabled"&gt;&lt;/span&gt;
                                                &lt;/td&gt;
                                                &lt;td&gt;
                                                    &lt;span id="cphContent_cphSadrzaj_lvVoda_ListView1_0_Label10_1" style="color:Black;"&gt;08.12.20&lt;/span&gt;
                                                &lt;/td&gt;
                                                &lt;/tr&gt;&lt;tr class="tableRow"&gt;
                                                &lt;/tr&gt;
                                            
                                            &lt;tr&gt;
                                                &lt;td class="tableNapomena" colspan="6"&gt;
                                                    &lt;div id="" style="border: 0px; margin: 0px; padding: 0px; overflow-y: hidden; visibility: visible; height: 0px; display: none;" class=""&gt;&lt;div id="cphContent_cphSadrzaj_lvVoda_ListView1_0_ManagingPanel_1" style="visibility: visible; height: auto;"&gt;
		
                                                        Navedenim područjem kružiti će autocisterna
                                                    
	&lt;/div&gt;&lt;/div&gt;
                                                    &lt;input type="hidden" name="ctl00$ctl00$cphContent$cphSadrzaj$lvVoda$ctrl0$ListView1$ctrl1$CollapsiblePanelExtender1_ClientState" id="cphContent_cphSadrzaj_lvVoda_ListView1_0_CollapsiblePanelExtender1_ClientState_1" value="true"&gt;
                                                &lt;/td&gt;
                                            &lt;/tr&gt;
                                        
                                            &lt;tr&gt;
                                                &lt;td&gt;
                                                    
                                                    
                                                &lt;/td&gt;
                                                &lt;td class="ulica"&gt;
                                                    &lt;span id="cphContent_cphSadrzaj_lvVoda_ListView1_0_Label2_2" style="color:Black;"&gt;ISTARSKA, Rijeka&lt;/span&gt;
                                                &lt;/td&gt;
                                                &lt;td class="kucnibroj"&gt;
                                                    &lt;span id="cphContent_cphSadrzaj_lvVoda_ListView1_0_Label7_2" style="color:Black;"&gt;64&lt;/span&gt;
                                                &lt;/td&gt;
                                                &lt;td&gt;
                                                    &lt;span id="cphContent_cphSadrzaj_lvVoda_ListView1_0_Label8_2" style="color:Black;"&gt;10:00&lt;/span&gt;
                                                &lt;/td&gt;
                                                &lt;td&gt;
                                                    &lt;span id="cphContent_cphSadrzaj_lvVoda_ListView1_0_Label9_2" style="color:Black;"&gt;14:00&lt;/span&gt;
                                                &lt;/td&gt;
                                                &lt;td&gt;
                                                    &lt;span class="aspNetDisabled"&gt;&lt;input id="cphContent_cphSadrzaj_lvVoda_ListView1_0_CheckBox1_2" type="checkbox" name="ctl00$ctl00$cphContent$cphSadrzaj$lvVoda$ctrl0$ListView1$ctrl2$CheckBox1" disabled="disabled"&gt;&lt;/span&gt;
                                                &lt;/td&gt;
                                                &lt;td&gt;
                                                    &lt;span id="cphContent_cphSadrzaj_lvVoda_ListView1_0_Label10_2" style="color:Black;"&gt;08.12.20&lt;/span&gt;
                                                &lt;/td&gt;
                                                &lt;/tr&gt;&lt;tr class="tableRow"&gt;
                                                &lt;/tr&gt;
                                            
                                            &lt;tr&gt;
                                                &lt;td class="tableNapomena" colspan="6"&gt;
                                                    &lt;div id="" style="border: 0px; margin: 0px; padding: 0px; overflow-y: hidden; visibility: visible; height: 0px; display: none;" class=""&gt;&lt;div id="cphContent_cphSadrzaj_lvVoda_ListView1_0_ManagingPanel_2" style="visibility: visible; height: auto;"&gt;
		
                                                        
                                                    
	&lt;/div&gt;&lt;/div&gt;
                                                    &lt;input type="hidden" name="ctl00$ctl00$cphContent$cphSadrzaj$lvVoda$ctrl0$ListView1$ctrl2$CollapsiblePanelExtender1_ClientState" id="cphContent_cphSadrzaj_lvVoda_ListView1_0_CollapsiblePanelExtender1_ClientState_2" value="true"&gt;
                                                &lt;/td&gt;
                                            &lt;/tr&gt;
                                        
                                            &lt;tr&gt;
                                                &lt;td&gt;
                                                    
                                                    
                                                &lt;/td&gt;
                                                &lt;td class="ulica"&gt;
                                                    &lt;span id="cphContent_cphSadrzaj_lvVoda_ListView1_0_Label2_3" style="color:Black;"&gt;KASTAVSKA, Rijeka&lt;/span&gt;
                                                &lt;/td&gt;
                                                &lt;td class="kucnibroj"&gt;
                                                    &lt;span id="cphContent_cphSadrzaj_lvVoda_ListView1_0_Label7_3" style="color:Black;"&gt;&lt;/span&gt;
                                                &lt;/td&gt;
                                                &lt;td&gt;
                                                    &lt;span id="cphContent_cphSadrzaj_lvVoda_ListView1_0_Label8_3" style="color:Black;"&gt;10:00&lt;/span&gt;
                                                &lt;/td&gt;
                                                &lt;td&gt;
                                                    &lt;span id="cphContent_cphSadrzaj_lvVoda_ListView1_0_Label9_3" style="color:Black;"&gt;14:00&lt;/span&gt;
                                                &lt;/td&gt;
                                                &lt;td&gt;
                                                    &lt;span class="aspNetDisabled"&gt;&lt;input id="cphContent_cphSadrzaj_lvVoda_ListView1_0_CheckBox1_3" type="checkbox" name="ctl00$ctl00$cphContent$cphSadrzaj$lvVoda$ctrl0$ListView1$ctrl3$CheckBox1" disabled="disabled"&gt;&lt;/span&gt;
                                                &lt;/td&gt;
                                                &lt;td&gt;
                                                    &lt;span id="cphContent_cphSadrzaj_lvVoda_ListView1_0_Label10_3" style="color:Black;"&gt;08.12.20&lt;/span&gt;
                                                &lt;/td&gt;
                                                &lt;/tr&gt;&lt;tr class="tableRow"&gt;
                                                &lt;/tr&gt;
                                            
                                            &lt;tr&gt;
                                                &lt;td class="tableNapomena" colspan="6"&gt;
                                                    &lt;div id="" style="border: 0px; margin: 0px; padding: 0px; overflow-y: hidden; visibility: visible; height: 0px; display: none;" class=""&gt;&lt;div id="cphContent_cphSadrzaj_lvVoda_ListView1_0_ManagingPanel_3" style="visibility: visible; height: auto;"&gt;
		
                                                        
                                                    
	&lt;/div&gt;&lt;/div&gt;
                                                    &lt;input type="hidden" name="ctl00$ctl00$cphContent$cphSadrzaj$lvVoda$ctrl0$ListView1$ctrl3$CollapsiblePanelExtender1_ClientState" id="cphContent_cphSadrzaj_lvVoda_ListView1_0_CollapsiblePanelExtender1_ClientState_3" value="true"&gt;
                                                &lt;/td&gt;
                                            &lt;/tr&gt;
                                        
                                            &lt;tr&gt;
                                                &lt;td&gt;
                                                    
                                                    
                                                &lt;/td&gt;
                                                &lt;td class="ulica"&gt;
                                                    &lt;span id="cphContent_cphSadrzaj_lvVoda_ListView1_0_Label2_4" style="color:Black;"&gt;MATE BALOTE, Rijeka&lt;/span&gt;
                                                &lt;/td&gt;
                                                &lt;td class="kucnibroj"&gt;
                                                    &lt;span id="cphContent_cphSadrzaj_lvVoda_ListView1_0_Label7_4" style="color:Black;"&gt;3-14&lt;/span&gt;
                                                &lt;/td&gt;
                                                &lt;td&gt;
                                                    &lt;span id="cphContent_cphSadrzaj_lvVoda_ListView1_0_Label8_4" style="color:Black;"&gt;10:00&lt;/span&gt;
                                                &lt;/td&gt;
                                                &lt;td&gt;
                                                    &lt;span id="cphContent_cphSadrzaj_lvVoda_ListView1_0_Label9_4" style="color:Black;"&gt;14:00&lt;/span&gt;
                                                &lt;/td&gt;
                                                &lt;td&gt;
                                                    &lt;span class="aspNetDisabled"&gt;&lt;input id="cphContent_cphSadrzaj_lvVoda_ListView1_0_CheckBox1_4" type="checkbox" name="ctl00$ctl00$cphContent$cphSadrzaj$lvVoda$ctrl0$ListView1$ctrl4$CheckBox1" disabled="disabled"&gt;&lt;/span&gt;
                                                &lt;/td&gt;
                                                &lt;td&gt;
                                                    &lt;span id="cphContent_cphSadrzaj_lvVoda_ListView1_0_Label10_4" style="color:Black;"&gt;08.12.20&lt;/span&gt;
                                                &lt;/td&gt;
                                                &lt;/tr&gt;&lt;tr class="tableRow"&gt;
                                                &lt;/tr&gt;
                                            
                                            &lt;tr&gt;
                                                &lt;td class="tableNapomena" colspan="6"&gt;
                                                    &lt;div id="" style="border: 0px; margin: 0px; padding: 0px; overflow-y: hidden; visibility: visible; height: 0px; display: none;" class=""&gt;&lt;div id="cphContent_cphSadrzaj_lvVoda_ListView1_0_ManagingPanel_4" style="visibility: visible; height: auto;"&gt;
		
                                                        
                                                    
	&lt;/div&gt;&lt;/div&gt;
                                                    &lt;input type="hidden" name="ctl00$ctl00$cphContent$cphSadrzaj$lvVoda$ctrl0$ListView1$ctrl4$CollapsiblePanelExtender1_ClientState" id="cphContent_cphSadrzaj_lvVoda_ListView1_0_CollapsiblePanelExtender1_ClientState_4" value="true"&gt;
                                                &lt;/td&gt;
                                            &lt;/tr&gt;
                                        
                                        
                                
                                    &lt;tr class="datum"&gt;
                                        &lt;th&gt;
                                            &lt;div style="font-size: 11px;"&gt;
                                                09.12.2020     // second date and all rest data after
                                            &lt;/div&gt;
                                        &lt;/th&gt;
                                    &lt;/tr&gt;
                                    
                                            
                                            &lt;tr&gt;
                                                &lt;td&gt;
                                                    
                                                    
                                                &lt;/td&gt;
                                                &lt;td class="ulica"&gt;
                                                    &lt;span id="cphContent_cphSadrzaj_lvVoda_ListView1_1_Label2_0" style="color:Black;"&gt;ISTARSKA, Rijeka&lt;/span&gt;
                                                &lt;/td&gt;
                                                &lt;td class="kucnibroj"&gt;
                                                    &lt;span id="cphContent_cphSadrzaj_lvVoda_ListView1_1_Label7_0" style="color:Black;"&gt;64&lt;/span&gt;
                                                &lt;/td&gt;
                                                &lt;td&gt;
                                                    &lt;span id="cphContent_cphSadrzaj_lvVoda_ListView1_1_Label8_0" style="color:Black;"&gt;10:00&lt;/span&gt;
                                                &lt;/td&gt;
                                                &lt;td&gt;
                                                    &lt;span id="cphContent_cphSadrzaj_lvVoda_ListView1_1_Label9_0" style="color:Black;"&gt;14:00&lt;/span&gt;
                                                &lt;/td&gt;
                                                &lt;td&gt;
                                                    &lt;span class="aspNetDisabled"&gt;&lt;input id="cphContent_cphSadrzaj_lvVoda_ListView1_1_CheckBox1_0" type="checkbox" name="ctl00$ctl00$cphContent$cphSadrzaj$lvVoda$ctrl1$ListView1$ctrl0$CheckBox1" disabled="disabled"&gt;&lt;/span&gt;
                                                &lt;/td&gt;
                                                &lt;td&gt;
                                                    &lt;span id="cphContent_cphSadrzaj_lvVoda_ListView1_1_Label10_0" style="color:Black;"&gt;09.12.20&lt;/span&gt;
                                                &lt;/td&gt;
                                                &lt;/tr&gt;&lt;tr class="tableRow"&gt;
                                                &lt;/tr&gt;
                                            
                                            &lt;tr&gt;
                                                &lt;td class="tableNapomena" colspan="6"&gt;
                                                    &lt;div id="" style="border: 0px; margin: 0px; padding: 0px; overflow-y: hidden; visibility: visible; height: 0px; display: none;" class=""&gt;&lt;div id="cphContent_cphSadrzaj_lvVoda_ListView1_1_ManagingPanel_0" style="visibility: visible; height: auto;"&gt;
		
                                                        
                                                    
	&lt;/div&gt;&lt;/div&gt;
                                                    &lt;input type="hidden" name="ctl00$ctl00$cphContent$cphSadrzaj$lvVoda$ctrl1$ListView1$ctrl0$CollapsiblePanelExtender1_ClientState" id="cphContent_cphSadrzaj_lvVoda_ListView1_1_CollapsiblePanelExtender1_ClientState_0" value="true"&gt;
                                                &lt;/td&gt;
                                            &lt;/tr&gt;
                                        
                                            &lt;tr&gt;
                                                &lt;td&gt;
                                                    
                                                    
                                                &lt;/td&gt;
                                                &lt;td class="ulica"&gt;
                                                    &lt;span id="cphContent_cphSadrzaj_lvVoda_ListView1_1_Label2_1" style="color:Black;"&gt;KASTAVSKA, Rijeka&lt;/span&gt;
                                                &lt;/td&gt;
                                                &lt;td class="kucnibroj"&gt;
                                                    &lt;span id="cphContent_cphSadrzaj_lvVoda_ListView1_1_Label7_1" style="color:Black;"&gt;&lt;/span&gt;
                                                &lt;/td&gt;
                                                &lt;td&gt;
                                                    &lt;span id="cphContent_cphSadrzaj_lvVoda_ListView1_1_Label8_1" style="color:Black;"&gt;10:00&lt;/span&gt;
                                                &lt;/td&gt;
                                                &lt;td&gt;
                                                    &lt;span id="cphContent_cphSadrzaj_lvVoda_ListView1_1_Label9_1" style="color:Black;"&gt;14:00&lt;/span&gt;
                                                &lt;/td&gt;
                                                &lt;td&gt;
                                                    &lt;span class="aspNetDisabled"&gt;&lt;input id="cphContent_cphSadrzaj_lvVoda_ListView1_1_CheckBox1_1" type="checkbox" name="ctl00$ctl00$cphContent$cphSadrzaj$lvVoda$ctrl1$ListView1$ctrl1$CheckBox1" disabled="disabled"&gt;&lt;/span&gt;
                                                &lt;/td&gt;
                                                &lt;td&gt;
                                                    &lt;span id="cphContent_cphSadrzaj_lvVoda_ListView1_1_Label10_1" style="color:Black;"&gt;09.12.20&lt;/span&gt;
                                                &lt;/td&gt;
                                                &lt;/tr&gt;&lt;tr class="tableRow"&gt;
                                                &lt;/tr&gt;
                                            
                                            &lt;tr&gt;
                                                &lt;td class="tableNapomena" colspan="6"&gt;
                                                    &lt;div id="" style="border: 0px; margin: 0px; padding: 0px; overflow-y: hidden; visibility: visible; height: 0px; display: none;" class=""&gt;&lt;div id="cphContent_cphSadrzaj_lvVoda_ListView1_1_ManagingPanel_1" style="visibility: visible; height: auto;"&gt;
		
                                                        
                                                    
	&lt;/div&gt;&lt;/div&gt;
                                                    &lt;input type="hidden" name="ctl00$ctl00$cphContent$cphSadrzaj$lvVoda$ctrl1$ListView1$ctrl1$CollapsiblePanelExtender1_ClientState" id="cphContent_cphSadrzaj_lvVoda_ListView1_1_CollapsiblePanelExtender1_ClientState_1" value="true"&gt;
                                                &lt;/td&gt;
                                            &lt;/tr&gt;
                                        
                                            &lt;tr&gt;
                                                &lt;td&gt;
                                                    
                                                    
                                                &lt;/td&gt;
                                                &lt;td class="ulica"&gt;
                                                    &lt;span id="cphContent_cphSadrzaj_lvVoda_ListView1_1_Label2_2" style="color:Black;"&gt;MATE BALOTE, Rijeka&lt;/span&gt;
                                                &lt;/td&gt;
                                                &lt;td class="kucnibroj"&gt;
                                                    &lt;span id="cphContent_cphSadrzaj_lvVoda_ListView1_1_Label7_2" style="color:Black;"&gt;3-14&lt;/span&gt;
                                                &lt;/td&gt;
                                                &lt;td&gt;
                                                    &lt;span id="cphContent_cphSadrzaj_lvVoda_ListView1_1_Label8_2" style="color:Black;"&gt;10:00&lt;/span&gt;
                                                &lt;/td&gt;
                                                &lt;td&gt;
                                                    &lt;span id="cphContent_cphSadrzaj_lvVoda_ListView1_1_Label9_2" style="color:Black;"&gt;14:00&lt;/span&gt;
                                                &lt;/td&gt;
                                                &lt;td&gt;
                                                    &lt;span class="aspNetDisabled"&gt;&lt;input id="cphContent_cphSadrzaj_lvVoda_ListView1_1_CheckBox1_2" type="checkbox" name="ctl00$ctl00$cphContent$cphSadrzaj$lvVoda$ctrl1$ListView1$ctrl2$CheckBox1" disabled="disabled"&gt;&lt;/span&gt;
                                                &lt;/td&gt;
                                                &lt;td&gt;
                                                    &lt;span id="cphContent_cphSadrzaj_lvVoda_ListView1_1_Label10_2" style="color:Black;"&gt;09.12.20&lt;/span&gt;
                                                &lt;/td&gt;
                                                &lt;/tr&gt;&lt;tr class="tableRow"&gt;
                                                &lt;/tr&gt;
                                            
                                            &lt;tr&gt;
                                                &lt;td class="tableNapomena" colspan="6"&gt;
                                                    &lt;div id="" style="border: 0px; margin: 0px; padding: 0px; overflow-y: hidden; visibility: visible; height: 0px; display: none;" class=""&gt;&lt;div id="cphContent_cphSadrzaj_lvVoda_ListView1_1_ManagingPanel_2" style="visibility: visible; height: auto;"&gt;
		
                                                        
                                                    
	&lt;/div&gt;&lt;/div&gt;
                                                    &lt;input type="hidden" name="ctl00$ctl00$cphContent$cphSadrzaj$lvVoda$ctrl1$ListView1$ctrl2$CollapsiblePanelExtender1_ClientState" id="cphContent_cphSadrzaj_lvVoda_ListView1_1_CollapsiblePanelExtender1_ClientState_2" value="true"&gt;
                                                &lt;/td&gt;
                                            &lt;/tr&gt;
                                        
                                        
                                
                                    &lt;/tbody&gt;&lt;/table&gt;
</code></pre>
<p dir="auto">How to get date end all  object inside that date till new date and so on<br />
First date:</p>
<pre><code>                                    &lt;tr&gt;
                                        &lt;th&gt;
                                            &lt;div&gt;
                                                08.12.2020
                                            &lt;/div&gt;
                                        &lt;/th&gt;
                                    &lt;/tr&gt;
</code></pre>
<p dir="auto">Im getting data as</p>
<pre><code>[
  {
    street: 'BUJSKA, Rijeka',
    streetNmbr: '30,32,34,36',
    startTime: '09:00',
    endTime: '11:00',
    endWork: '07.12.20'
  },
  {
    street: 'LABINSKA, Rijeka',
    streetNmbr: '18,20',
    startTime: '09:00',
    endTime: '11:00',
    endWork: '07.12.20'
  },
  ......
]
</code></pre>
<p dir="auto">but i would like to add the starting date like this</p>
<pre><code>[
  {
  startDate:'07.12.20',
  data:
     {
  
    street: 'BUJSKA, Rijeka',
    streetNmbr: '30,32,34,36',
    startTime: '09:00',
    endTime: '11:00',
    endWork: '07.12.20'
	},
	{
    street: 'LABINSKA, Rijeka',
    streetNmbr: '18,20',
    startTime: '09:00',
    endTime: '11:00',
    endWork: '08.12.20'
    }
  },
  {
  startDate:'08.12.20',
  data:
    {
    street: 'LABINSKA, Rijeka',
    streetNmbr: '18,20',
    startTime: '09:00',
    endTime: '11:00',
    endWork: '08.12.20'
    }
  }
]
</code></pre>
<p dir="auto">I was unable to upload images to explain it better.<br />
Sorry, English is not my nativ language and im just start learning JS .</p>
]]></description><link>https://forum.magicmirror.builders/topic/14204/help-with-puppeteer-cheerio-and-json</link><generator>RSS for Node</generator><lastBuildDate>Tue, 15 Sep 2026 03:20:07 GMT</lastBuildDate><atom:link href="https://forum.magicmirror.builders/topic/14204.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 08 Dec 2020 17:21:47 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Help with puppeteer ,cheerio and json on Mon, 14 Dec 2020 21:28:22 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/lolo" aria-label="Profile: lolo">@<bdi>lolo</bdi></a> i cannot help with look. Totally useless here</p>
]]></description><link>https://forum.magicmirror.builders/post/85760</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/85760</guid><dc:creator><![CDATA[sdetweil]]></dc:creator><pubDate>Mon, 14 Dec 2020 21:28:22 GMT</pubDate></item><item><title><![CDATA[Reply to Help with puppeteer ,cheerio and json on Mon, 14 Dec 2020 19:01:14 GMT]]></title><description><![CDATA[<p dir="auto">This is output of my module. Any suggestion about styling.<br />
<img src="/assets/uploads/files/1607972020686-srdo%C4%8Di.png" alt="srdoči.PNG" class=" img-fluid img-markdown" /><br />
<img src="/assets/uploads/files/1607972254600-%C5%A1mrika.png" alt="šmrika.PNG" class=" img-fluid img-markdown" /><br />
<img src="/assets/uploads/files/1607972234524-brneli%C4%87i.png" alt="brnelići.PNG" class=" img-fluid img-markdown" /><br />
croatian<br />
<img src="/assets/uploads/files/1607972396431-brneli%C4%87i2.png" alt="brnelići2.PNG" class=" img-fluid img-markdown" /></p>
<p dir="auto">I know there are more things to make it better but i have to learn it first.</p>
]]></description><link>https://forum.magicmirror.builders/post/85751</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/85751</guid><dc:creator><![CDATA[lolo]]></dc:creator><pubDate>Mon, 14 Dec 2020 19:01:14 GMT</pubDate></item><item><title><![CDATA[Reply to Help with puppeteer ,cheerio and json on Wed, 09 Dec 2020 12:42:25 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/lolo" aria-label="Profile: lolo">@<bdi>lolo</bdi></a> cool</p>
]]></description><link>https://forum.magicmirror.builders/post/85597</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/85597</guid><dc:creator><![CDATA[sdetweil]]></dc:creator><pubDate>Wed, 09 Dec 2020 12:42:25 GMT</pubDate></item><item><title><![CDATA[Reply to Help with puppeteer ,cheerio and json on Wed, 09 Dec 2020 11:47:03 GMT]]></title><description><![CDATA[<p dir="auto">I think i managed to sort it out.</p>
<pre><code>	const $ = cheerio.load(html);
    
	var water = [];
        var waterList = [];
        var el = $('#cphContent_cphSadrzaj_upVoda table tbody ');
    
	if (el) {
               var elementWater = $('#cphContent_cphSadrzaj_upVoda table tbody  span').filter(function () {
                  return $(this).text() === self.place;
                   }).parent().parent();
             $(elementWater).each(function (jex, edate) {

            const $edate = $(edate);
            var startDate = $edate.prev().find('tr[class="datum"]&gt;th&gt;div').text().trim();
            var street = $edate.find('span[id*="Label2"]').text();
            var streetNmbr = $edate.find('span[id*="Label7"]').text();
            var startTime = $edate.find('span[id*="Label8"]').text();
            var endTime = $edate.find('span[id*="Label9"]').text();
            var endWork = $edate.find('span[id*="Label10"]').text();

            var water = {
                startDate,
                street,
                streetNmbr,
                startTime,
                endTime,
                endWork
            };
            
        
            waterList.push(water);
            console.log(water);
        });

    };
    if (!el) {
        console.log('No new entries!');
    };
    var waterWork = JSON.parse(JSON.stringify(waterList));
    self.sendSocketNotification('ELECTRIC_POWER_DISCONNECTED', waterWork);
</code></pre>
<p dir="auto">Now i can get all data  sorted by config.place</p>
<pre><code> {
  startDate: '09.12.2020',
  street: 'ISTARSKA, Rijeka',
  streetNmbr: '64',
  startTime: '10:00',
  endTime: '14:00',
  endWork: '09.12.20'
}

</code></pre>
]]></description><link>https://forum.magicmirror.builders/post/85595</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/85595</guid><dc:creator><![CDATA[lolo]]></dc:creator><pubDate>Wed, 09 Dec 2020 11:47:03 GMT</pubDate></item><item><title><![CDATA[Reply to Help with puppeteer ,cheerio and json on Tue, 08 Dec 2020 20:28:33 GMT]]></title><description><![CDATA[<p dir="auto">Yes I’m getting date , but this one is  endWork (kraj). When the interruption will end, not to start. I know maybe I should use that.</p>
]]></description><link>https://forum.magicmirror.builders/post/85580</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/85580</guid><dc:creator><![CDATA[lolo]]></dc:creator><pubDate>Tue, 08 Dec 2020 20:28:33 GMT</pubDate></item><item><title><![CDATA[Reply to Help with puppeteer ,cheerio and json on Tue, 08 Dec 2020 20:15:25 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/lolo" aria-label="Profile: lolo">@<bdi>lolo</bdi></a> but u have the date already in the object. Sort them maybe, but cheerio should return the list in order.</p>
]]></description><link>https://forum.magicmirror.builders/post/85577</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/85577</guid><dc:creator><![CDATA[sdetweil]]></dc:creator><pubDate>Tue, 08 Dec 2020 20:15:25 GMT</pubDate></item><item><title><![CDATA[Reply to Help with puppeteer ,cheerio and json on Tue, 08 Dec 2020 19:42:54 GMT]]></title><description><![CDATA[<p dir="auto">Thanks  for replay.<br />
I believe, I dint explained well.<br />
This is table from website. Screenshot.<br />
<img src="/assets/uploads/files/1607453979108-table.jpg" alt="table.jpg" class=" img-fluid img-markdown" /><br />
The data what i menage to collect is from prev sibling of tr class tableRow.<br />
What i wish to get is tr class datum as first date and then data of street, street number, time (all in span)   as data object in array, till next tr datum and then same after.<br />
For each span id is different but they sharing same part of one number in id.<br />
I cant use for for each as element (td or tr) as plenty of them are useless.<br />
And here I’m stuck. I tried different approaches  but then all data was multiplying or got empty object in arrays<br />
example from website<br />
<img src="/assets/uploads/files/1607454632745-date.png" alt="date.PNG" class=" img-fluid img-markdown" /><br />
<img src="/assets/uploads/files/1607456527536-capture.png" alt="Capture.PNG" class=" img-fluid img-markdown" /></p>
]]></description><link>https://forum.magicmirror.builders/post/85573</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/85573</guid><dc:creator><![CDATA[lolo]]></dc:creator><pubDate>Tue, 08 Dec 2020 19:42:54 GMT</pubDate></item><item><title><![CDATA[Reply to Help with puppeteer ,cheerio and json on Tue, 08 Dec 2020 18:50:43 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/lolo" aria-label="Profile: lolo">@<bdi>lolo</bdi></a> ignore the class= for the moment. that will just make it look prettier w colors etc</p>
<p dir="auto">A table is a list of rows. Which contain a list of columns<br />
A table is table<br />
A row is tr<br />
A column is td</p>
<p dir="auto">Your data is an array  []<br />
Of  objects{}</p>
<p dir="auto">You can  use the for loop to process you data<br />
This is pseudo code, I am on my phone<br />
for(let item of array_name){<br />
Create row.<br />
Create td = item.element_name<br />
Etc<br />
}</p>
]]></description><link>https://forum.magicmirror.builders/post/85566</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/85566</guid><dc:creator><![CDATA[sdetweil]]></dc:creator><pubDate>Tue, 08 Dec 2020 18:50:43 GMT</pubDate></item></channel></rss>