Created
August 17, 2017 07:24
-
-
Save mki/d3ed063c82c160b6f4dd7b7793498ab8 to your computer and use it in GitHub Desktop.
Yandex for optoplan
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
| var data = []; | |
| $('.b-link.b-phrase-link__link').each(function(){ | |
| data.push($(this).text()); | |
| }) | |
| $('.b-form-input__input').prop('value', data); |
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
| var avg = []; | |
| var sum = 0; | |
| $('.b-history__value-td').each(function(){ | |
| if ($(this).text().indexOf(',') == -1) { | |
| var v = parseInt($(this).html().replace(" ", "")); | |
| avg.push(v); | |
| sum += v; | |
| } | |
| }); | |
| var avg_r = parseInt(sum/avg.length); | |
| console.log(Math.min.apply(null, avg)+","+avg_r+","+Math.max.apply(null, avg)); |
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
| // Первый этап. Запустить и подождать пока пройдет скрипт. | |
| var data = []; | |
| var i=1000; | |
| $('.b-serp-item_type_search').each(function(){ | |
| var self = $(this); | |
| var item = []; | |
| setTimeout(function(){ | |
| item.push(self.find('.b-serp-item__title').text()); | |
| item.push(self.find('.b-serp-item__links').text()); | |
| self.trigger('click'); | |
| item.push($($('.ymaps-balloon-overlay')[0]).find('.b-serp-contacts__item_type_phone').text()); | |
| self.find('.b-serp-item__text').each(function(){ | |
| item.push($(this).text()); | |
| }); | |
| data.push(item); | |
| }, i); | |
| i = i + 1000; | |
| }); | |
| // Второй этап. | |
| $('body').append('<div id="data_ex"></div>'); | |
| for (var t=0; t < data.length; t++){ | |
| $('#data_ex').append(data[t].join(';') + "<br/>"); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment