const puppeteer = require('puppeteer');
const moment = require('moment');
const FAKE_USERAGENT = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_1) AppleWebKit/604.3.5 (KHTML, like Gecko) Version/11.0.1 Safari/604.3.5';
const YAHOO_URL = 'https://www.yahoo.co.jp';
const TARGET_ELEM = ''div#videoFesBoxbd > div#recommendfb > div.lCassette p.thumbnailImg'';
(async () => {
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 nums = [1,2,3,4,5] | |
| var ans = nums.reduce(function(x,y){ | |
| return x+y | |
| }) | |
| console.log(ans) |
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 m = [1,2,3,4,5].filter(function(e){ | |
| if (e>=4){ | |
| return e | |
| } | |
| }).map(function(e){ | |
| return e*e; | |
| }); | |
| console.log(m) |
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 = [ | |
| { | |
| regionId: 1, | |
| regionName: "Kanto", | |
| prefectures: [ | |
| {id: 1, name: "Tokyo", population: 10000}, | |
| {id: 2, name: "Kanagawa", population: 20000}, | |
| {id: 3, name: "Chiba", population: 300}, | |
| {id: 4, name: "Gunma", population: 20} | |
| ] |
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
| import csv | |
| files = [ | |
| "a.csv", | |
| "b.csv", | |
| "c.csv", | |
| "d.csv", | |
| "e.csv" | |
| ] | |
| BASE_PATH = "base_path/tobedecided" |
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
| import MeCab | |
| mecab = MeCab.Tagger("-Ochasen") | |
| print(mecab.parse("今日はいい天気ですね。")) |
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
| import numpy as np | |
| #mock data | |
| data = '''853 1,005 | |
| 992 876 | |
| 589 1,330 | |
| 1,532 389 | |
| 1,414 508 | |
| 1,237 652 | |
| ''' |
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
| Array.from(document.querySelectorAll('div.padT12.marB10.clearFix > table tr td:nth-child(5)')).map((e)=>e.innerText) |
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
| 1. Go visit https://folio-sec.com/ | |
| 2. Copy the following command on Chrome Developer Tool and execute it | |
| ```javascript | |
| [].concat.apply([], Array.from(document.querySelectorAll('section.slider.landingPageSlider div.slider__outer')).map((e)=>{ return Array.from(e.querySelectorAll('a.card')).map((e)=>{ var k = Array.from(e.querySelectorAll('h1.card__name > span')).map((e)=>{return e.textContent}).reduce((c,v)=>{return c+v}); var v = e.querySelector('div.card__return > p').textContent; return {'key':k, 'value':v}})})) | |
| ``` | |
| 3. You will get the json like the following: |
OlderNewer