ãã¹ã¯ã¬ã¤ãã³ã°ãã¼ã«ãé¢åãªæ å ±åéã¯Google Spreadsheetã«ãããããï¼
â»è¿½è¨ 2020å¹´3æ
DAINOTEç·¨éé¨ã§ãPythonã«ããã¹ã¯ã¬ã¤ãã³ã°ã®æ¹æ³ã«ã¤ãã¦ãç¡æãã¥ã¼ããªã¢ã«ãå ¬éãã¾ãããæªçµé¨ã®æ¹ã§ãããã°ãããã¼ã¿ãèªåæ½åºã§ãããã¥ã¼ããªã¢ã«ãªã®ã§ããã²è©¦ãã¦ã¿ã¦ãã ããï¼
æ¯æ¥åããããªä½æ¥ã§ãã®ããã«æã£ã¦ãã人ã¯ããªãã§ããããã
- ãï½æ¯æ¥ãããã«ã¢ã¯ã»ã¹ãã¦ãåããã¼ã¿åéããã®é¢åããããªã
- ããããéå±ãªä½æ¥ãèªåã§ãã£ã¦ãããªãããª
- ã§ãããã°ã©ãã³ã°ã§ããªãããªããåå¼·ããã®ãé¢åããããªãã
ãããªäººã«æå ±ã§ããä»åã¯ãããã°ã©ã ããããªã人ã§ãããããããæ å ±ãèªååéããæ¹æ³ãã¾ã¨ãã¾ãã
ä»å使ãã®ã¯ãGoogle Spreadsheetã¨ãããã¨ã¯ã»ã«ã«ä¼¼ãWebä¸ã®ã¢ããªã±ã¼ã·ã§ã³ã§ããå®ã¯ãããä¸ã®æ å ±ãèªç±ã«åå¾ï¼ã¹ã¯ã¬ã¤ãã³ã°ï¼ã§ãããã¼ã«ã ã¨ã¯ç¥ããã¦ãã¾ããããããªè£ã®ä½¿ãæ¹ãä»åã¯èª¬æãããã¨æãã¾ãã
ç®æ¬¡ (PRãå«ã¾ãã¾ãï¼
å¿ è¦ãªã®ã¯ããã¼ã¿ãåéããããã¼ã¸ã®URLã¨Google Spreadsheetã ã
ãã¨ã¯ããã¼ã¿ãåãåºãããæ å ±ãéãã¾ããåã®å ´åã¯ãèªåãNews Picksã«ã¢ãããã¼ãããè¨äºãä½ããã¯ãããã調ã¹ããã®ã§ãä»åã¯èªåã®News Picksã®è¨äºã®URLãæºåãã¾ããã
ãã¼ã¿ãåãããURLãã¹ãã¬ããã·ã¼ãã«ä¹ãã
ï¼WINDOWS)åå¾ããããã¼ã¸ã§F12ãæ¼ãã¦ãå ¥æãããæ å ±ãæ¤ç´¢ãã
åã®å ´åã¯titleãã»ããã£ãã®ã§ãtitleã¨æ¤ç´¢ããã¨ã¿ã¤ãã«ãå ¥ã£ã¦ããé¨åã®ã³ã¼ããè¦ã¤ããã¾ãã
GOOGLE SPREADSHEETã§ãIMPORTXMLé¢æ°ãå©ç¨ãã
åã®åå¾ããTITLEã®å ´åã¯ããã§ãã
=IMPORTXML(B2,"/html/head/title")
ããã§å ¥åãçµããã¨ãèªåã§ãã¼ã¿ãåå¾ãã¦ããã¾ãã
ä¸ã¾ã§ã ã ã ã¼ã¨ä¼¸ã°ãã¦ããã¨ã»ã»ã»ã»
å ¨é¨ã¿ã¤ãã«ãåå¾ã§ãã¾ããï¼ãã£ããï¼
PICKæ°ãåå¾ãã¦ã¿ã
ã©ãããªãã¿ã¤ãã«ã¨ããã¯æ°ãè¦ã¦ã¿ããã§ãããä»åº¦ã¯Picksæ°ãæ¢ãã¾ãã
ãã®1608 picksã¨ããæ°åãã¨ãããã§ã
ãã®ããã¯æ°ããã¹ã¦ã®è¨äºã§ã¨ã£ã¦ã¿ã¾ããããã
ãã£ãã¿ãããªæãã§ã¨ãã¾ãã
ctrl + fã§æ¤ç´¢ããã¨ããã®ä½æãã¼ã¿ãåºã¦ãã¾ãã
ãããå³ã¯ãªãã¯ãã¦ãCopy > Copy Xpathãåå¾ãã¾ãã
ãã¨ã¯å ¨ãåãããã«ãã£ã¦ã¿ã¾ãã
=IMPORTXML(B2,"/html/body/div[2]/div[2]/div[2]/div/div[1]/div[3]")
ããããã¨å ¨é¨ã®ããã¯æ°ãåå¾ãã¦ããã¾ãããã¡ããã¹ãã¬ããã·ã¼ããã¨ã¯ã»ã«ã¨åãããã«ä½¿ããã®ã§ããã£ã«ã¿ã使ã£ã¦ä¸¦ã³æ¿ããããã§ãã¾ãã
ããã°ã©ãã³ã°ãè¦ããªãã¦ããå ¨ç¶ã§ããã®ã§éå®ãã¾ãã
ããã°ã©ãã³ã°ãæ¸ããã«ã¹ã¯ã¬ã¤ãã³ã°ããããªã Octoparse
å ¬å¼ãµã¤ãï¼https://www.octoparse.jp/
ãOctoparseãã¯ãç¡æãã¤ããã°ã©ãã³ã°ä¸è¦ã®Webã¹ã¯ã¬ã¤ãã³ã°ãã¼ã«ã§ãï¼
ãOctoparseãã®ããã¨ããã¯ãæ°ãããããããªãã®ã§ãããçµãã¨ä»¥ä¸ã®3ç¹ã§ãï¼
- ç¡æçã§ãããã¨ãããªãå¤ãã
- ããã°ã©ãã³ã°çµé¨ãå ¨ããªã人ã§ãããã¼ã¿ã®åå¾ãèªååã§ããã
ç¡æçã§ãããã¨ãããªãå¤ãã
Octoparseã¯ãç¡æçã§ã以ä¸ã®ãããªãã¼ã¿ãç°¡åã«åå¾ãããã¨ãã§ãã¾ãã
- ECãµã¤ãã®æ¤ç´¢çµæããåå詳細ãªã©ã®ãã¼ã¿
- ã¡ãã£ã¢ããã¥ã¼ã¹ãµã¤ããªã©ã®è¨äºãã¼ã¿
- SNSã®æ稿ãã¼ã¿
ææçã¨ç¡æçã®éãã¯ãããã¤ãããã¾ãã代表çãªãã®ã¯ä»¥ä¸ã®2ã¤ã§ãã
- ã¿ã¹ã¯ã®å®æå®è¡ãã§ããªãã
- APIã使ããã¨ãã§ããªãã
ããã°ã©ãã³ã°çµé¨ãå ¨ããªã人ã§ãããã¼ã¿ã®åå¾ãèªååã§ããã
ã¾ããOctoparseãå©ç¨ããä¸çªã®ã¡ãªããã¯ãããã°ã©ãã³ã°çµé¨ãå ¨ããªã人ã§ãã¹ã¯ã¬ã¤ãã³ã°ããã¦ããã¼ã¿åå¾ãèªååã§ããã¨ãããã¨ã§ãã
é常ãããã°ã©ãã³ã°å®å ¨æªçµé¨ã®æ¹ãã¹ã¯ã¬ã¤ãã³ã°ããããã¨ããã¨ã以ä¸ã®ãããªèª²é¡ã«ç´é¢ãã¾ãã
- HTMLãCSSãJavaScriptãPythonãªã©ãè¤æ°ã®è¨èªãå¦ç¿ããªããã°ãªããªãã
- PCä¸ã§ç°å¢æ§ç¯ãªã©ãããªããã°ãªããªãã
- å®æå®è¡ããããå ´åã¯ãä»®æ³ãµã¼ãã¼ãªã©ã®ç¥èãã¤ããå¿ è¦ãããã
ãããããèªåã§ãã£ã¦ã¿ããã®ã®ã¨ã©ã¼ãã§ã¦ã»ãããã¼ã¿ãåå¾ã§ããªããªã©ã®äºæ ã«é¥ãå ´åããããçµå±æéãããªã浪費ãã¦ãã¾ã…ã¨ãããã¨ãããå¾ã¾ãã
â»ææçã使ãã°ããã¼ã¿åå¾ã®å®æå®è¡ãªã©ãå¯è½ãªãããããã°ã©ãã³ã°ãå¦ç¿ããªããã°ã§ããªãã£ããã¨ã®å¤ããOctoparseã使ãã°ã¯ãªãã¯ã ãã§ç½®ãæãããã¨ãå¯è½ã«ãªãã¾ãã