{"id":19816176,"url":"https://github.com/naoki-00-ito/js-scraping","last_synced_at":"2025-06-30T11:34:43.118Z","repository":{"id":157020019,"uuid":"633205576","full_name":"naoki-00-ito/js-scraping","owner":"naoki-00-ito","description":"Webスクレイピングプラグラム","archived":false,"fork":false,"pushed_at":"2024-05-30T12:26:37.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-11T07:50:07.054Z","etag":null,"topics":["dotenv","javascript","nodejs","puppeteer","scraping"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/naoki-00-ito.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-04-27T02:19:12.000Z","updated_at":"2024-08-22T08:38:09.000Z","dependencies_parsed_at":"2024-05-30T14:10:41.605Z","dependency_job_id":"dc5759ba-58cf-4679-9ea7-5094b3a812ba","html_url":"https://github.com/naoki-00-ito/js-scraping","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naoki-00-ito%2Fjs-scraping","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naoki-00-ito%2Fjs-scraping/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naoki-00-ito%2Fjs-scraping/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naoki-00-ito%2Fjs-scraping/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/naoki-00-ito","download_url":"https://codeload.github.com/naoki-00-ito/js-scraping/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241170223,"owners_count":19921571,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dotenv","javascript","nodejs","puppeteer","scraping"],"created_at":"2024-11-12T10:08:38.289Z","updated_at":"2025-02-28T14:54:52.209Z","avatar_url":"https://github.com/naoki-00-ito.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# js-scraping\n\nサイトリニューアル等で、既存サイトのテキストやリンク設定等をそのまま使いたい(構造変更の必要はある)とき用のスクレイピングプラグラム。\n\n## 環境情報\n\n- node 14.16.0\n- npm 6.14.11\n- puppeteer 19.11.1\n- dotenv 16.0.3\n\n\n## 利用方法\n\npackageをインストールする\n\n```\nnpm install \n```\n\n.env を作成し、スクレイピング対象のページのURLを記述する\n\n```\nPAGE_URL=https://www.hoge.hoge\n```\n\nscraping.js内、スクレイピング要素指定変数の値を対象要素のセレクターに書き換える\n\n```diff\n- const selectorItemWrap = \".item\";\n- const selectorTitle = \".title\";\n- const selectorText = \".text\";\n- const selectorLink = \".link\";\n+ const selectorItemWrap = \".col\";\n+ const selectorTitle = \".col__title\";\n+ const selectorText = \".col__text\";\n+ const selectorLink = \".col__link\";\n```\n\nスクレイピングを実行する\n\n```\nnode scraping.js\n```\n\ndistディレクトリにCSVが出力される\n\n![スクリーンショット 2023-04-27 18 10 08](https://user-images.githubusercontent.com/117070296/234815955-b98bdb7b-7df0-413e-8b09-358f8eb74d40.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnaoki-00-ito%2Fjs-scraping","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnaoki-00-ito%2Fjs-scraping","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnaoki-00-ito%2Fjs-scraping/lists"}