LoginSignup
3
1

More than 5 years have passed since last update.

「データを集める技術」より(自分用のメモ)

Posted at

概要

「データを集める技術」を読んで参考になったことをまとめておく。自分用。
スクレイピングとかについて書かれていた。

メモの内容

Excel上からネット上のデータを集める

  • WEBSERVICE関数 → 文字数が32,767文字以上だとエラーになる
  • FILTERXML関数

Google Apps Scriptでスクレイピング

  1. URLを指定
  2. UrlfetchApp.fetch(url)でソースのデータを取得
  3. response.getContent Text ("UTF-8")
  4. content.match(/(.*?)<¥/title>/) ※タイトルの場合

スクレイピングサービス

  • import.io

Slack

アプリをインストールできる(Apps&integrations)
(ex. RSSのアプリ)

myThings

モバイル用のアプリ。Twitterの特定のツイートが合った場合に通知を受けることができる。

スプレッドシート

Importfeed関数(RSSフィードを取得する)

Google Apps ScriptのFetchAppクラス

クローリングの際のユーザーエージェントを変えられる。
また、GASの実行時間の上限は5分
Xml Serviceクラス…XMLを操作するクラス
- getElement By Attribute
- getElement By ClassName
- getElement By Id
- getElement By TagName

GASのライブラリ

Parser…取得したい場所の始まりと終わりのテキストを指定し、その間のコンテンツを抜き出す

3
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
1