<!DOCTYPE html>
<html lang="ja">
<head>
      <!-- Google tag (gtag.js) -->
    <script async data-type="lazy" data-src="https://www.googletagmanager.com/gtag/js?id=G-Z8CZSPX2HG"></script>
    <script>
      window.dataLayer = window.dataLayer || [];
      function gtag(){dataLayer.push(arguments);}
      gtag('js', new Date());
      gtag('config', 'G-Z8CZSPX2HG');
    </script>
    <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta name="format-detection" content="telephone=no">
  <title>楽天の指定年の領収書を(Ruby)Seleniumで一括ダウンロードした話</title>
  <meta name='robots' content='index, follow, max-image-preview:large, max-snippet:-1, max-video-preview:-1' />

	<!-- This site is optimized with the Yoast SEO plugin v28.7 - https://yoast.com/product/yoast-seo-wordpress/ -->
	<meta name="description" content="通常一括ダウンロードができない楽天の指定年の領収書ですが、(Ruby)Seleniumで一括でダウンロードできるプログラムをで実装しましたのでご紹介します。" />
	<link rel="canonical" href="https://brandnew.work/column/ruby/dl-all-rakuten_invoices/" />
	<meta property="og:locale" content="ja_JP" />
	<meta property="og:type" content="article" />
	<meta property="og:title" content="楽天の指定年の領収書を(Ruby)Seleniumで一括ダウンロードした話" />
	<meta property="og:description" content="通常一括ダウンロードができない楽天の指定年の領収書ですが、(Ruby)Seleniumで一括でダウンロードできるプログラムをで実装しましたのでご紹介します。" />
	<meta property="og:url" content="https://brandnew.work/column/ruby/dl-all-rakuten_invoices/" />
	<meta property="og:site_name" content="[ brandnew ]" />
	<meta property="article:published_time" content="2024-02-19T12:16:03+00:00" />
	<meta property="article:modified_time" content="2026-02-21T05:13:19+00:00" />
	<meta property="og:image" content="https://brandnew.work/wp-content/uploads/dl-all-rakuten_invoices.png" />
	<meta property="og:image:width" content="1092" />
	<meta property="og:image:height" content="614" />
	<meta property="og:image:type" content="image/png" />
	<meta name="author" content="brandnew" />
	<meta name="twitter:card" content="summary_large_image" />
	<meta name="twitter:label1" content="執筆者" />
	<meta name="twitter:data1" content="brandnew" />
	<meta name="twitter:label2" content="推定読み取り時間" />
	<meta name="twitter:data2" content="16分" />
	<script type="application/ld+json" class="yoast-schema-graph">{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/brandnew.work\/column\/ruby\/dl-all-rakuten_invoices\/#article","isPartOf":{"@id":"https:\/\/brandnew.work\/column\/ruby\/dl-all-rakuten_invoices\/"},"author":{"name":"brandnew","@id":"https:\/\/brandnew.work\/#\/schema\/person\/e8bbee2ead4c00ed5a0e246af50d958c"},"headline":"楽天の指定年の領収書を(Ruby)Seleniumで一括ダウンロードした話","datePublished":"2024-02-19T12:16:03+00:00","dateModified":"2026-02-21T05:13:19+00:00","mainEntityOfPage":{"@id":"https:\/\/brandnew.work\/column\/ruby\/dl-all-rakuten_invoices\/"},"wordCount":76,"publisher":{"@id":"https:\/\/brandnew.work\/#\/schema\/person\/e8bbee2ead4c00ed5a0e246af50d958c"},"image":{"@id":"https:\/\/brandnew.work\/column\/ruby\/dl-all-rakuten_invoices\/#primaryimage"},"thumbnailUrl":"https:\/\/brandnew.work\/wp-content\/uploads\/dl-all-rakuten_invoices.png","articleSection":["Ruby"],"inLanguage":"ja"},{"@type":"WebPage","@id":"https:\/\/brandnew.work\/column\/ruby\/dl-all-rakuten_invoices\/","url":"https:\/\/brandnew.work\/column\/ruby\/dl-all-rakuten_invoices\/","name":"楽天の指定年の領収書を(Ruby)Seleniumで一括ダウンロードした話","isPartOf":{"@id":"https:\/\/brandnew.work\/#website"},"primaryImageOfPage":{"@id":"https:\/\/brandnew.work\/column\/ruby\/dl-all-rakuten_invoices\/#primaryimage"},"image":{"@id":"https:\/\/brandnew.work\/column\/ruby\/dl-all-rakuten_invoices\/#primaryimage"},"thumbnailUrl":"https:\/\/brandnew.work\/wp-content\/uploads\/dl-all-rakuten_invoices.png","datePublished":"2024-02-19T12:16:03+00:00","dateModified":"2026-02-21T05:13:19+00:00","description":"通常一括ダウンロードができない楽天の指定年の領収書ですが、(Ruby)Seleniumで一括でダウンロードできるプログラムをで実装しましたのでご紹介します。","breadcrumb":{"@id":"https:\/\/brandnew.work\/column\/ruby\/dl-all-rakuten_invoices\/#breadcrumb"},"inLanguage":"ja","potentialAction":[{"@type":"ReadAction","target":["https:\/\/brandnew.work\/column\/ruby\/dl-all-rakuten_invoices\/"]}]},{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/brandnew.work\/column\/ruby\/dl-all-rakuten_invoices\/#primaryimage","url":"https:\/\/brandnew.work\/wp-content\/uploads\/dl-all-rakuten_invoices.png","contentUrl":"https:\/\/brandnew.work\/wp-content\/uploads\/dl-all-rakuten_invoices.png","width":1092,"height":614},{"@type":"BreadcrumbList","@id":"https:\/\/brandnew.work\/column\/ruby\/dl-all-rakuten_invoices\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"ホーム","item":"https:\/\/brandnew.work\/"},{"@type":"ListItem","position":2,"name":"Column","item":"https:\/\/brandnew.work\/column\/"},{"@type":"ListItem","position":3,"name":"楽天の指定年の領収書を(Ruby)Seleniumで一括ダウンロードした話"}]},{"@type":"WebSite","@id":"https:\/\/brandnew.work\/#website","url":"https:\/\/brandnew.work\/","name":"[ brandnew ]","description":"","publisher":{"@id":"https:\/\/brandnew.work\/#\/schema\/person\/e8bbee2ead4c00ed5a0e246af50d958c"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/brandnew.work\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ja"},{"@type":["Person","Organization"],"@id":"https:\/\/brandnew.work\/#\/schema\/person\/e8bbee2ead4c00ed5a0e246af50d958c","name":"brandnew","image":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/brandnew.work\/wp-content\/uploads\/ogp-image.png","url":"https:\/\/brandnew.work\/wp-content\/uploads\/ogp-image.png","contentUrl":"https:\/\/brandnew.work\/wp-content\/uploads\/ogp-image.png","width":1200,"height":630,"caption":"brandnew"},"logo":{"@id":"https:\/\/brandnew.work\/wp-content\/uploads\/ogp-image.png"}}]}</script>
	<!-- / Yoast SEO plugin. -->


<style id="wp-img-auto-sizes-contain-inline-css">
img:is([sizes=auto i],[sizes^="auto," i]){contain-intrinsic-size:3000px 1500px}
/*# sourceURL=wp-img-auto-sizes-contain-inline-css */
</style>
<link rel='stylesheet' id='feca-member-bootstrap-css' href='https://brandnew.work/wp-content/themes/portfolio/member/src/member-bootstrap-grid.css?ver=1713272970' media='all' />
<link rel='stylesheet' id='feca-css' href='https://brandnew.work/wp-content/themes/portfolio/member/src/feca.css?ver=1713272969' media='all' />
<style id="classic-theme-styles-inline-css">
/*! This file is auto-generated */
.wp-block-button__link{color:#fff;background-color:#32373c;border-radius:9999px;box-shadow:none;text-decoration:none;padding:calc(.667em + 2px) calc(1.333em + 2px);font-size:1.125em}.wp-block-file__button{background:#32373c;color:#fff;text-decoration:none}
/*# sourceURL=/wp-includes/css/classic-themes.min.css */
</style>
<style id="wp-block-styles-placeholder-inline-css">
:root { --wp-internal-comment: "Placeholder for wp_hoist_late_printed_styles() to replace with the block styles printed at wp_footer." }
/*# sourceURL=wp-block-styles-placeholder-inline-css */
</style>
<style id="wp-global-styles-placeholder-inline-css">
:root { --wp-internal-comment: "Placeholder for wp_hoist_late_printed_styles() to replace with the global-styles printed at wp_footer." }
/*# sourceURL=wp-global-styles-placeholder-inline-css */
</style>
<link rel='stylesheet' id='cookie-notice-front-css' href='https://brandnew.work/wp-content/plugins/cookie-notice/css/front.min.css?ver=3.1.17' media='all' />
<link rel='stylesheet' id='normalize_style-css' href='https://brandnew.work/wp-content/themes/portfolio/css/normalize.css?ver=2023090900513' media='all' />
<link rel='stylesheet' id='page_style_post-css' href='https://brandnew.work/wp-content/themes/portfolio/css/post.css?ver=2023090900513' media='all' />
<link rel='stylesheet' id='addBlogCard_style-css' href='https://brandnew.work/wp-content/themes/portfolio/functions/addBlogCard/addBlogCard.css?ver=7.1.3' media='all' />
<link rel='stylesheet' id='wp-members-css' href='https://brandnew.work/wp-content/plugins/wp-members/assets/css/forms/generic-no-float.min.css?ver=3.5.2' media='all' />
<link rel='stylesheet' id='hcb-style-css' href='https://brandnew.work/wp-content/plugins/highlighting-code-block/build/css/hcb--dark.css?ver=2.2.1' media='all' />
<style id="hcb-style-inline-css">
:root{--hcb--fz--base: 13px}:root{--hcb--fz--mobile: 13px}:root{--hcb--ff:'Source Code Pro', "source-han-sans-japanese", sans-serif}
/*# sourceURL=hcb-style-inline-css */
</style>
<script id="jquery-core-js" src="https://brandnew.work/wp-includes/js/jquery/jquery.min.js?ver=3.7.1"></script>
<script id="jquery-migrate-js" src="https://brandnew.work/wp-includes/js/jquery/jquery-migrate.min.js?ver=3.4.1&#039;%20defer%20charset=&#039;UTF-8' defer charset='UTF-8"></script>
<script id="cookie-notice-front-js-before">
var cnArgs = {"ajaxUrl":"https:\/\/brandnew.work\/wp-admin\/admin-ajax.php","nonce":"0130845243","hideEffect":"fade","position":"bottom","onScroll":false,"onScrollOffset":100,"onClick":false,"cookieName":"cookie_notice_accepted","cookieTime":2592000,"cookieTimeRejected":2592000,"globalCookie":false,"redirection":false,"cache":false,"revokeCookies":false,"revokeCookiesOpt":"automatic"};

//# sourceURL=cookie-notice-front-js-before
</script>
<script id="cookie-notice-front-js" src="https://brandnew.work/wp-content/plugins/cookie-notice/js/front.min.js?ver=3.1.17&#039;%20defer%20charset=&#039;UTF-8' defer charset='UTF-8"></script>
    <meta name="msapplication-square70x70logo" content="https://brandnew.work/wp-content/themes/portfolio/assets/favicon/site-tile-70x70.png">
  <meta name="msapplication-square150x150logo" content="https://brandnew.work/wp-content/themes/portfolio/assets/favicon/site-tile-150x150.png">
  <meta name="msapplication-wide310x150logo" content="https://brandnew.work/wp-content/themes/portfolio/assets/favicon/site-tile-310x150.png">
  <meta name="msapplication-square310x310logo" content="https://brandnew.work/wp-content/themes/portfolio/assets/favicon/site-tile-310x310.png">
  <meta name="msapplication-TileColor" content="#fff">
  <link rel="apple-touch-icon" sizes="57x57" href="https://brandnew.work/wp-content/themes/portfolio/assets/favicon/apple-touch-icon-57x57.png">
  <link rel="apple-touch-icon" sizes="60x60" href="https://brandnew.work/wp-content/themes/portfolio/assets/favicon/apple-touch-icon-60x60.png">
  <link rel="apple-touch-icon" sizes="72x72" href="https://brandnew.work/wp-content/themes/portfolio/assets/favicon/apple-touch-icon-72x72.png">
  <link rel="apple-touch-icon" sizes="76x76" href="https://brandnew.work/wp-content/themes/portfolio/assets/favicon/apple-touch-icon-76x76.png">
  <link rel="apple-touch-icon" sizes="114x114" href="https://brandnew.work/wp-content/themes/portfolio/assets/favicon/apple-touch-icon-114x114.png">
  <link rel="apple-touch-icon" sizes="120x120" href="https://brandnew.work/wp-content/themes/portfolio/assets/favicon/apple-touch-icon-120x120.png">
  <link rel="apple-touch-icon" sizes="144x144" href="https://brandnew.work/wp-content/themes/portfolio/assets/favicon/apple-touch-icon-144x144.png">
  <link rel="apple-touch-icon" sizes="152x152" href="https://brandnew.work/wp-content/themes/portfolio/assets/favicon/apple-touch-icon-152x152.png">
  <link rel="apple-touch-icon" sizes="180x180" href="https://brandnew.work/wp-content/themes/portfolio/assets/favicon/apple-touch-icon-180x180.png">
  <link rel="icon" type="image/png" sizes="36x36" href="https://brandnew.work/wp-content/themes/portfolio/assets/favicon/android-chrome-36x36.png">
  <link rel="icon" type="image/png" sizes="48x48" href="https://brandnew.work/wp-content/themes/portfolio/assets/favicon/android-chrome-48x48.png">
  <link rel="icon" type="image/png" sizes="72x72" href="https://brandnew.work/wp-content/themes/portfolio/assets/favicon/android-chrome-72x72.png">
  <link rel="icon" type="image/png" sizes="96x96" href="https://brandnew.work/wp-content/themes/portfolio/assets/favicon/android-chrome-96x96.png">
  <link rel="icon" type="image/png" sizes="128x128" href="https://brandnew.work/wp-content/themes/portfolio/assets/favicon/android-chrome-128x128.png">
  <link rel="icon" type="image/png" sizes="144x144" href="https://brandnew.work/wp-content/themes/portfolio/assets/favicon/android-chrome-144x144.png">
  <link rel="icon" type="image/png" sizes="152x152" href="https://brandnew.work/wp-content/themes/portfolio/assets/favicon/android-chrome-152x152.png">
  <link rel="icon" type="image/png" sizes="192x192" href="https://brandnew.work/wp-content/themes/portfolio/assets/favicon/android-chrome-192x192.png">
  <link rel="icon" type="image/png" sizes="256x256" href="https://brandnew.work/wp-content/themes/portfolio/assets/favicon/android-chrome-256x256.png">
  <link rel="icon" type="image/png" sizes="384x384" href="https://brandnew.work/wp-content/themes/portfolio/assets/favicon/android-chrome-384x384.png">
  <link rel="icon" type="image/png" sizes="512x512" href="https://brandnew.work/wp-content/themes/portfolio/assets/favicon/android-chrome-512x512.png">
  <link rel="icon" type="image/png" sizes="36x36" href="https://brandnew.work/wp-content/themes/portfolio/assets/favicon/icon-36x36.png">
  <link rel="icon" type="image/png" sizes="48x48" href="https://brandnew.work/wp-content/themes/portfolio/assets/favicon/icon-48x48.png">
  <link rel="icon" type="image/png" sizes="72x72" href="https://brandnew.work/wp-content/themes/portfolio/assets/favicon/icon-72x72.png">
  <link rel="icon" type="image/png" sizes="96x96" href="https://brandnew.work/wp-content/themes/portfolio/assets/favicon/icon-96x96.png">
  <link rel="icon" type="image/png" sizes="128x128" href="https://brandnew.work/wp-content/themes/portfolio/assets/favicon/icon-128x128.png">
  <link rel="icon" type="image/png" sizes="144x144" href="https://brandnew.work/wp-content/themes/portfolio/assets/favicon/icon-144x144.png">
  <link rel="icon" type="image/png" sizes="152x152" href="https://brandnew.work/wp-content/themes/portfolio/assets/favicon/icon-152x152.png">
  <link rel="icon" type="image/png" sizes="160x160" href="https://brandnew.work/wp-content/themes/portfolio/assets/favicon/icon-160x160.png">
  <link rel="icon" type="image/png" sizes="192x192" href="https://brandnew.work/wp-content/themes/portfolio/assets/favicon/icon-192x192.png">
  <link rel="icon" type="image/png" sizes="196x196" href="https://brandnew.work/wp-content/themes/portfolio/assets/favicon/icon-196x196.png">
  <link rel="icon" type="image/png" sizes="256x256" href="https://brandnew.work/wp-content/themes/portfolio/assets/favicon/icon-256x256.png">
  <link rel="icon" type="image/png" sizes="384x384" href="https://brandnew.work/wp-content/themes/portfolio/assets/favicon/icon-384x384.png">
  <link rel="icon" type="image/png" sizes="512x512" href="https://brandnew.work/wp-content/themes/portfolio/assets/favicon/icon-512x512.png">
  <link rel="icon" type="image/png" sizes="16x16" href="https://brandnew.work/wp-content/themes/portfolio/assets/favicon/icon-16x16.png">
  <link rel="icon" type="image/png" sizes="24x24" href="https://brandnew.work/wp-content/themes/portfolio/assets/favicon/icon-24x24.png">
  <link rel="icon" type="image/png" sizes="32x32" href="https://brandnew.work/wp-content/themes/portfolio/assets/favicon/icon-32x32.png">
  <link rel="manifest" href="https://brandnew.work/wp-content/themes/portfolio/assets/favicon/manifest.json">
  <!-- <script>
    (function(d) {
      var config = {
        kitId: 'ndw5cyp',
        scriptTimeout: 3000,
        async: true
      },
      h=d.documentElement,t=setTimeout(function(){h.className=h.className.replace(/\bwf-loading\b/g,"")+" wf-inactive";},config.scriptTimeout),tk=d.createElement("script"),f=false,s=d.getElementsByTagName("script")[0],a;h.className+=" wf-loading";tk.src='https://use.typekit.net/'+config.kitId+'.js';tk.async=true;tk.onload=tk.onreadystatechange=function(){a=this.readyState;if(f||a&&a!="complete"&&a!="loaded")return;f=true;clearTimeout(t);try{Typekit.load(config)}catch(e){}};s.parentNode.insertBefore(tk,s)
    })(document);
  </script> -->
      <style>
      .grecaptcha-badge { visibility: hidden; }
    </style>
  </head>
<body class="wp-singular post-template-default single single-post postid-1841 single-format-standard wp-theme-portfolio cookies-not-set">

  <div id="Loader" class="loader">
    <typerighter text="[ brandnew ]" />
  </div>

  
    <header class="header">
      <div class="header__wrap">
                  <p class="header__logo" title="[ brandnew ]">
            <a href="https://brandnew.work">[ brandnew ]</a>
          </p>
                <div class="header__contents">
          <div class="header-navBtn"></div>
              <nav class="header-nav">
      <div class="menu-header-nav-container"><ul id="menu-header-nav" class="header-nav__inner"><li id="menu-item-448" class="menu-item menu-item-type-post_type menu-item-object-page current_page_parent menu-item-448"><a href="https://brandnew.work/column/">Column</a></li>
<li id="menu-item-449" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-449"><a href="https://brandnew.work/about/">About</a></li>
<li id="menu-item-1446" class="menu-item menu-item-type-post_type_archive menu-item-object-portfolio menu-item-1446"><a href="https://brandnew.work/portfolio/">Portfolio</a></li>
<li id="menu-item-1270" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-1270"><a href="https://brandnew.work/service/">Service</a></li>
</ul></div>    </nav>          <a href="https://brandnew.work/contact" class="btn-block" aria-label="contact">
            <span hover-text="Thanks!" text="contact"></span>
          </a>
        </div>
      </div>
    </header>

  
      <div class="main-sub">
  <div class="inner">
    <h1 class="title__main" number="Ruby" data-aos="fade-left">楽天の指定年の領収書を(Ruby)Seleniumで一括ダウンロードした話</h1>
          <div class="main-sub__meta" data-aos="fade-left" data-aos-delay="250">
        <ul class="main-sub__categories">
          <li><a href='https://brandnew.work/column/category/ruby/'>Ruby</a></li>        </ul>
        <div class="main-sub__time">
          <time datetime="2024-02-19">
            2024.02.19          </time>
                      <time datetime="2026-02-21">
              / Update 2026.02.21            </time>
                  </div>
      </div>

      </div>
</div>

  

  <!------------ main ------------>
  <div class="inner post__inner pb-0">
    <main class="post__main">
      <article data-aos="fade-up">
        <div class="single__eyecatch" loading="lazy">
                      <img src="https://brandnew.work/wp-content/uploads/dl-all-rakuten_invoices-1024x576.png" width="770" height="433" alt="楽天の指定年の領収書を(Ruby)Seleniumで一括ダウンロードした話">
                  </div>
        <div class="sns-share">
<div class="sns-share__title">share!!</div>

<a href="https://twitter.com/share?url=https://brandnew.work/column/ruby/dl-all-rakuten_invoices/&via=brandnew_work&related=brandnew_work&text=楽天の指定年の領収書を(Ruby)Seleniumで一括ダウンロードした話" 
rel="nofollow noopener" 
target="_blank"
class="sns-share__item sns-share__item--twitter" 
aria-label="twitter"
><span class="icon-twitter"></span></a>

<a href="http://line.me/R/msg/text/?https://brandnew.work/column/ruby/dl-all-rakuten_invoices/%0a楽天の指定年の領収書を(Ruby)Seleniumで一括ダウンロードした話"
target="_blank" rel="nofollow noopener"
class="sns-share__item sns-share__item--line" 
aria-label="LINE"
><span class="icon-line"></span></a>

<a href="http://b.hatena.ne.jp/add?mode=confirm&url=https://brandnew.work/column/ruby/dl-all-rakuten_invoices/&title=楽天の指定年の領収書を(Ruby)Seleniumで一括ダウンロードした話"
rel="nofollow noopener" target="_blank"
class="sns-share__item sns-share__item--hateb" 
aria-label="はてぶ"
><span class="icon-hateb"></span></a>

<a href="http://getpocket.com/edit?url=https://brandnew.work/column/ruby/dl-all-rakuten_invoices/&title=楽天の指定年の領収書を(Ruby)Seleniumで一括ダウンロードした話"
rel="nofollow" target="_blank" class="sns-share__item sns-share__item--pocket"
aria-label="Pocket"
><span class="icon-pocket"></span></a>

</div>

        <section class="post-content">
          <div class="content-box">
<div class="content-box__inner">
<p class="content-box__title"># 2026/2/21 追記</p>
<p>2025年に楽天の購入履歴ページの仕様が変更されたため仕様を調整しました。<br />
使用調整に伴い、ログイン情報などを.envで管理できるよう調整しました。<br />
<span style="font-size: 0.8rem;">コードの説明は追記しません。</span></p>
<p class="content-box__title"># 2025/1/14 追記</p>
<p>2024年に楽天の購入履歴ページの仕様が変更されたため仕様を調整しました。<br />
使用調整に伴い、領収書pdfの保存先を指定できるよう調整しました。<br />
前年はWSLでの確認でしたが、今回はMac（Mac Sonoma 14.6.1）への対応も確認済みとなります。<br />
<span style="font-size: 0.8rem;">※コードの説明は追記しません。</span></p>
</div>
</div>
<p>2月になると個人事業主にとって面倒な確定申告の時期ですね。。<br />
私はめんどくさがりなので、月末に領収書を整理することもなく、<br />
この時期になると慌ただしくなり始めます。</p>
<p>特に面倒なのが楽天市場で購入した商品の領収書取得。。。<br />
私の場合、<b><span class="marker-pink">年間100件近い領収書を1つづつダウンロード</span></b>していかなくてはなりません。<br />
それも毎年。。。これは苦行。。。</p>
<p>ということで、<br />
楽天の指定年の領収書を一括でダウンロードするプログラムをSelenium（Ruby）で組んでみました。<b><br />
</b>Seleniumを選んだ理由は、<b>楽天側でJs処理が走るので、mechanizeでは対応できない</b>と思い、<br />
使用したことのあるSeleniumにしました。</p>
<p>結果としてはできたのですが、ビックカメラや楽天Koboなどの<br />
<b><span class="marker-yellow">通常とは異なる領収書発行が必要な決済については、<br />
下記の点から今回はスルー</span></b>し、手動での取得にしました。</p>
<ul>
<li>通常の取得から更にページ複数をまたぐ</li>
<li>そもそもの決済数が少ない</li>
</ul>
<p>ただ、それでも自分の場合は90%以上を自動で賄えましたので、<br />
来年からは作業時間もかなり短縮されるでしょう。</p>
<p>また、<b>領収書のファイル名</b>も「order_receipt_注文番号.pdf」となっており、<br />
自分が期待するものではなかったので、その点もPDFの内容を解析し、<br />
<b><span class="marker-yellow">独自のファイル名をつけるように設定</span></b>しました。</p>
<p>こんな記事を書いて怒られないか心配ですが、とりあえず見ていきましょう。</p>
<div class="content-box">
<div class="content-box__inner">
<p class="content-box__title"># この記事で解決すること</p>
<ul>
<li><b>楽天の領収書を一括でダウンロードできる</b><span style="font-size: 0.8rem;">（特殊な領収書発行が必要な場合を除く）</span></li>
<li><b>領収書のpdfファイル名をpdfの中身を解析して変更できる</b></li>
</ul>
</div>
</div>
<p style="text-align: center;"><a href='https://github.com/brandnew-work/rakuten_invoice' area-label='githubで閲覧' class='btn-block github' target='__blank'><span hover-text='view' text='githubで閲覧'></span></a></p>
<h2><span class="ez-toc-section" id="%e5%89%8d%e6%8f%90"></span>前提<span class="ez-toc-section-end"></span></h2>
<p>今回はWEBには公開せず、ローカルでRubyを使用してCLI内で行います。</p>
<p>かかる時間は、購入一覧までの処理を除き、1件につき5秒程度です。（120件で5分程度）</p>
<h3><span class="ez-toc-section" id="%e7%92%b0%e5%a2%83"></span>環境<span class="ez-toc-section-end"></span></h3>
<ul>
<li>WSL / Mac Sonoma 14.6.1</li>
<li>ruby 3.1.2p20</li>
</ul>
<h3><span class="ez-toc-section" id="%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%9f%e3%83%a9%e3%82%a4%e3%83%96%e3%83%a9%e3%83%aa"></span>使用したライブラリ<span class="ez-toc-section-end"></span></h3>
<ul>
<li>selenium-webdriver 4.17.0</li>
<li>pdf-reader 2.12.0</li>
</ul>
<h2><span class="ez-toc-section" id="%e5%87%a6%e7%90%86%e3%81%ae%e9%a0%86%e5%ba%8f"></span>処理の順序<span class="ez-toc-section-end"></span></h2>
<ul>
<li>Ruby側の処理</li>
<li>Seleniumの処理
<ul>
<li>ログイン処理</li>
<li>指定年の購入履歴ページへ移動</li>
<li>領収書の取得</li>
</ul>
</li>
<li>ファイル名を変更</li>
</ul>
<h2><span class="ez-toc-section" id="ruby%e5%81%b4%e3%81%ae%e5%87%a6%e7%90%86"></span>Ruby側の処理<span class="ez-toc-section-end"></span></h2>
<p>まずは「ID・パスワード・取得年・宛名」が必要ですので、<br />
CLIで入力するためのコードを挿入します。<br />
<span style="font-size: 0.8rem;">※ローカル処理がメインなので、直書きでも良いかも。。。</span></p>
<div class="hcb_wrap">
<pre class="prism line-numbers lang-ruby" data-lang="Ruby"><code>p 'IDを入力してください'
id = gets.chomp
p 'パスワードを入力してください'
password = gets.chomp
p '取得する年を入力してください'
year = gets.chomp
p '請求書の宛名を入力してください'
$myname = gets.chomp</code></pre>
</div>
<p><b>8行目</b></p>
<p class="pl-low"><code>$myname</code>のみ関数内で使用するので、グローバル変数で指定してます。</p>
<h2><span class="ez-toc-section" id="selenium%e3%81%ae%e5%87%a6%e7%90%86"></span>Seleniumの処理<span class="ez-toc-section-end"></span></h2>
<h3><span class="ez-toc-section" id="%e3%83%ad%e3%82%b0%e3%82%a4%e3%83%b3%e5%87%a6%e7%90%86"></span>ログイン処理<span class="ez-toc-section-end"></span></h3>
<div>
<div>
<div class="hcb_wrap">
<pre class="prism line-numbers lang-ruby" data-lang="Ruby"><code>options = Selenium::WebDriver::Chrome::Options.new
options.add_argument('--headless')
session = Selenium::WebDriver.for :chrome, options: options
session.manage.timeouts.implicit_wait = 10

session.navigate.to 'https://grp02.id.rakuten.co.jp/rms/nid/vc?__event=login&amp;service_id=s08&amp;fidomy=1'
login_form = session.find_element(:name, 'LoginForm')
login_name = session.find_element(:name, 'u')
login_pass = session.find_element(:name, 'p')
login_name.send_keys(id)
login_pass.send_keys(password)
login_form.submit
sleep(1)</code></pre>
</div>
</div>
</div>
<p><b>1～4行目</b></p>
<p class="pl-low">Seleniumの初期設定になります。<br />
<b><span class="marker-pink">今回はheadlessで取得</span></b>します。<br />
4行目は10秒経過しても進まない場合、相手のサーバーにとって迷惑なので、<br />
処理を停止し、エラーを返します。</p>
<p><b>6～12行目</b></p>
<p class="pl-low">ログイン画面に移動し、ログインします。</p>
<p><b>13行目</b></p>
<p class="pl-low">今回のプログラムに共通して言えることですが、ページ遷移の際は、<br />
相手のサーバーに負荷をかけないために、最低でも1秒は待つという業界の暗黙の了解です。</p>
<h3><span class="ez-toc-section" id="%e6%8c%87%e5%ae%9a%e5%b9%b4%e3%81%ae%e8%b3%bc%e5%85%a5%e5%b1%a5%e6%ad%b4%e3%83%9a%e3%83%bc%e3%82%b8%e3%81%b8%e7%a7%bb%e5%8b%95"></span>指定年の購入履歴ページへ移動<span class="ez-toc-section-end"></span></h3>
<div class="hcb_wrap">
<pre class="prism line-numbers lang-ruby" data-lang="Ruby"><code>session.find_element(:xpath, "//a[@aria-label='購入履歴']").click
sleep(1)

year_value = session.find_element(:name, 'display_span')
year_value.send_keys(year)
sleep(1)</code></pre>
</div>
<p><b>1行目</b></p>
<p class="pl-low">そのままでも購入履歴ページへたどり着くと思いますが、仕様が変わった際のことも考え、<br />
購入履歴ページ再度遷移するようにしています。</p>
<p><b>4, 5行目</b></p>
<p class="pl-low">最初にCLIで入力した「取得する年」を指定年のselectで選択します<br />
これで、取得する年の購入履歴ページへ遷移することができます。</p>
<h3><span class="ez-toc-section" id="%e9%a0%98%e5%8f%8e%e6%9b%b8%e3%81%ae%e5%8f%96%e5%be%97"></span>領収書の取得<span class="ez-toc-section-end"></span></h3>
<div class="hcb_wrap">
<pre class="prism line-numbers lang-ruby" data-lang="Ruby"><code># 一覧ページ数取得
total_item_count = session.find_element(:xpath, "//div[@class='oDrPager']//*[@class='totalItem']").text.to_i
total_item_pages = total_item_count.quo(25).to_f.ceil

# 注文詳細URLの一覧取得
1.upto(total_item_pages) do |num|

  ## インボイスの取得
  0.upto(24) do |i|
    item_list_url = 'https://order.my.rakuten.co.jp/?page=myorder&amp;act=list&amp;page_num=' + num.to_s
    session.navigate.to item_list_url
    sleep(1)
    return session.find_elements(:xpath, "//a[@data-ratid='ph_pc_orderdetail']")
    # 注文詳細ページでの処理
    if detail_link_list[i]
      href = detail_link_list[i].attribute('href')
      if href.include?('order.my.rakuten.co.jp')
        session.navigate.to href
        sleep(1)
        getInvoice(session)
        sleep(1)
      else
        pp "error: #{href}"
      end
    else
      pp 'complete: all'
      break
    end
  end
  if total_item_pages == 1
    pp 'complete: all'
    break
  end
  pp "complete: #{num}"
end

# ブラウザを終了
session.quit</code></pre>
</div>
<p><b>1～3行目</b></p>
<p class="pl-low">決済の総数を取得し、そこから一覧のページ数を割り出しています。<br />
楽天は件数変更ができず25件表示固定なので、この方法で問題ないかと。<br />
<span style="font-size: 0.8rem;">※paginationを辿っても良さそうなのですが、<br />
</span><span style="font-size: 0.8rem;">そんなに大量に注文しておらず、仕様が不明だったのでこの方法に落ち着きました。</span></p>
<p><b>6行目</b></p>
<p class="pl-low">本当は全てのURLを取得してからループさせたかったのですが、<br />
Sleniumの仕様上、前回のページで取得した情報を引き継げないようですので、<br />
各一覧ページごとに処理することにしました。</p>
<p><b>9～13行目</b></p>
<p class="pl-low">1ページの商品件数は25件固定なので、25回ループさせます。<br />
処理としては、<code>num</code>番目の一覧ページにある<br />
注文詳細ページへのリンクURL一覧を取得して返すというものです。<br />
回りくどいことをしていますが、<br />
<b><span class="marker-yellow">前回のページで取得した情報を引き継げないというSeleniumの仕様</span></b>に則ったものです。<br />
これをなくすと、1つ目は取得できても、2つ目からはエラーが返ります。</p>
<p><b>15～24行目</b></p>
<p class="pl-low">先程取得したリンクURL一覧から、<code>i</code>番目に該当するものの<code>href</code>を取得し遷移します。<br />
注意点は、<b><span class="marker-yellow"><code>order.my.rakuten.co.jp</code>以外の注文詳細は特殊な領収書発行に該当</span></b>します。<br />
そのため、エラーログを返して後で見返せるようにしています。</p>
<div class="pl-low">
<p><b><code>getInvoice(session)</code>について</b></p>
<div class="pl-low">
<div class="hcb_wrap">
<pre class="prism line-numbers lang-ruby" data-lang="Ruby"><code>def getInvoice(session)
  pp "start: #{session.current_url}"
  if !session.find_elements(:name, 'receipt_name').empty?
    receipt_name = session.find_element(:name, 'receipt_name')
    receipt_disabled = receipt_name.attribute('disabled')
    if !receipt_disabled
      receipt_name.send_keys($myname)
    end
    session.find_element(:class, 'receiptBtn').click
    if !session.find_elements(:id, 'invoiceReceiptDonwloadBtn').empty? &amp;&amp; !receipt_disabled
      session.find_element(:id, 'invoiceReceiptDonwloadBtn').click
    end
    pp "complete: #{session.current_url}"
  else
    pp "error: #{session.current_url}"
  end
end</code></pre>
</div>
</div>
<p class="pl-low">楽天の仕様上、一度発行した領収書の宛名は変更できません。<br />
また、領収書ダウンロードのボタンが、<br />
1段階目はプレーン、2段階目はModalで出現する場合もあるので、<br />
その辺りを加味した内容になっています。<br />
尚、<b><span class="marker-yellow">1段階目のプレーンなボタンすらない場合は、特殊な領収書発行に該当</span></b>しますので、<br />
エラーログを返すようにしています。</p>
</div>
<p><b>26, 27行目</b></p>
<p class="pl-low"><code>detail_link_list[i]</code>がない場合、仮に<code>i</code>が3だとすると、<br />
3以降は空だと推測できるのでcompleteログを出してループを抜けます。</p>
<p><b>30～33行目</b></p>
<p class="pl-low">仮に商品が20件しかない場合、一覧ページが1つだけという解釈になりますので、<br />
completeログを出してループを抜けます。</p>
<p><b>38行目</b></p>
<p class="pl-low">ここまでくると領収書は全てダウンロードされているはずですので、seleniumを終了します。</p>
<h2><span class="ez-toc-section" id="%e3%83%95%e3%82%a1%e3%82%a4%e3%83%ab%e5%90%8d%e3%82%92%e5%a4%89%e6%9b%b4"></span>ファイル名を変更<span class="ez-toc-section-end"></span></h2>
<p>さて、ここからは<code>pdf-reader</code>を使用して、任意のファイル名を変更していきます。<br />
<b><span class="marker-pink" style="font-size: 0.8rem;">※特殊な領収書発行に該当するものは、pdf内部の形式が異なるので手動です。</span></b></p>
<p>通常の領収書は<code>order_receipt_xxxxxx-xxxxxxxx-xxxxxxxxxx.pdf</code><span style="font-size: 0.8rem;">（xは注文番号）</span>となり、<br />
これでは、いつ・どこで・いくらの決済があった領収書かわからない状態です。</p>
<p>自分の場合は「<b>注文日（決済日）_ショップ名_金額</b>」にしたいので、それに沿って説明します。</p>
<div>
<div>
<div class="hcb_wrap">
<pre class="prism line-numbers lang-ruby" data-lang="Ruby"><code>invoice_files = Dir.glob('./*.pdf')
invoice_files.each do |path|
  pdf_file = File.basename(path)
  reader = PDF::Reader.new(pdf_file)
  reader.pages.each do |page|
    if page.number == 1
      page_text = page.text
      price = page_text.match(/([0-9|\,]{1,})円領収しました/)[1]
      full_date = page_text.match(/注文日[:|：][\s]??([0-9]{4})年([0-9]{1,2})月([0-9]{1,2})日??/) # 最後の日が別行として読み込まれている場合有
      date = "#{full_date[1]}#{full_date[2]}#{full_date[3]}"
      store = page_text.match(/但し[:|：][\s]??(.+)との取引/)[1]
      new_file_name = "#{date}_#{store}_#{price}.pdf"
      File.rename(pdf_file, new_file_name)
    end
  end
end</code></pre>
</div>
</div>
</div>
<p><b>1, 2行目</b></p>
<p class="pl-low">今回はseleniumにheadless指定していますので、<br />
<b><span class="marker-yellow">領収書のpdfファイルはrubyのファイルと同階層に保存されている</span></b>はずです。<br />
ですので、同階層にあるpdfファイル一覧を取得し、ループを回します。</p>
<p><b>3～6行目</b></p>
<p class="pl-low">pdfを処理するための下準備をして、ページごとにループを回します。<br />
この時、<b>2ページ目以降も処理してしまうと、無駄な処理が走ってしまう</b>ので、<br />
必要な情報が存在する1ページ目だけを処理します。</p>
<p><b>7～13行目</b></p>
<p class="pl-low">あとは、ページのテキストを取得して、<br />
そこから正規表現で「金額」「日付」「ショップ名」を取得し、リネームします。<br />
注意点は、9行目のように<b><span class="marker-yellow">思いがけないところに改行が入っている場合がある</span></b>という点です。</p>
<p>&nbsp;</p>
<p>これで全て完了です！</p>
<h2>最後に</h2>
<p>久々にSeleniumを使いましたが、思いの外簡単に楽天の領収書を発行することができて大満足です。</p>
<p>ただし、<b><span class="marker-pink">楽天の仕様が変われば、再調整が必要</span></b>になります。</p>
<p>規模の大きいモールなのでそんな簡単に変わることはないと思いますが。。。</p>
<p>また、pdf-readerは初めて使用しましたが、他の領収書にも流用できそうなので優秀ですね。</p>
<p>それでは、よい事業主ライフを！</p>
        </section>

        <div class="sns-share">
<div class="sns-share__title">share!!</div>

<a href="https://twitter.com/share?url=https://brandnew.work/column/ruby/dl-all-rakuten_invoices/&via=brandnew_work&related=brandnew_work&text=楽天の指定年の領収書を(Ruby)Seleniumで一括ダウンロードした話" 
rel="nofollow noopener" 
target="_blank"
class="sns-share__item sns-share__item--twitter" 
aria-label="twitter"
><span class="icon-twitter"></span></a>

<a href="http://line.me/R/msg/text/?https://brandnew.work/column/ruby/dl-all-rakuten_invoices/%0a楽天の指定年の領収書を(Ruby)Seleniumで一括ダウンロードした話"
target="_blank" rel="nofollow noopener"
class="sns-share__item sns-share__item--line" 
aria-label="LINE"
><span class="icon-line"></span></a>

<a href="http://b.hatena.ne.jp/add?mode=confirm&url=https://brandnew.work/column/ruby/dl-all-rakuten_invoices/&title=楽天の指定年の領収書を(Ruby)Seleniumで一括ダウンロードした話"
rel="nofollow noopener" target="_blank"
class="sns-share__item sns-share__item--hateb" 
aria-label="はてぶ"
><span class="icon-hateb"></span></a>

<a href="http://getpocket.com/edit?url=https://brandnew.work/column/ruby/dl-all-rakuten_invoices/&title=楽天の指定年の領収書を(Ruby)Seleniumで一括ダウンロードした話"
rel="nofollow" target="_blank" class="sns-share__item sns-share__item--pocket"
aria-label="Pocket"
><span class="icon-pocket"></span></a>

</div>

        <div class="author-info">
          <div class="author-info__thumb">
            <img src="https://brandnew.work/wp-content/themes/portfolio/assets/author.svg" alt="[ brandnew ]" width="100" height="100">
          </div>
          <div class="author-info__contents">
            <p class="author-info__title">[ brandnew ]に相談</p>
            <div class="author-info__description">
              <p>10年以上WEB業界に勤務。ディレクター・デザイナー・フロントエンド・管理職などの業務を経て今に至る。できることの幅が広く、オールラウンダーとして扱われることがしばしば。WordPressを最も得意としている。</p>
              <a href="https://brandnew.work/service" class="btn-block" aria-label="サービスを確認"><span hover-text="view" text="サービスを確認"></span></a>
              <a href="https://brandnew.work/contact" class="btn-block" aria-label="相談してみる"><span hover-text="Thanks!!" text="相談してみる"></span></a>
            </div>
          </div>
        </div>
      </article>
    </main>

    <aside class="post__aside">
  <div class="widget" data-aos="fade-up" data-aos-delay="250">
    <h2>related post</h2>
    <div class="post-item-horizons">
      
<a href="https://brandnew.work/column/ruby/dl-all-rakuten_invoices/" class="post-item-horizon">
  <div class="post-item-horizon__figure">
    <figure>
              <img src="https://brandnew.work/wp-content/uploads/dl-all-rakuten_invoices-150x150.png" loading="lazy" alt="楽天の指定年の領収書を(Ruby)Seleniumで一括ダウンロードした話" width="75" height="75">
          </figure>
  </div>
  <div class="post-item-horizon__contents">
    <h3 class="post-item-horizon__title">楽天の指定年の領収書を(Ruby)Seleniumで一括ダウンロードした話</h3>
    <div class="post-item-vertical__meta">
      <div class="post-item-vertical__category">
                <object><a href="https://brandnew.work/column/category/ruby/">Ruby</a></object>
      </div>
      <div class="post-item-vertical__time">
        <time datetime="2026-02-21">2026.02.21</time>
      </div>
    </div>
  </div>
</a>

<a href="https://brandnew.work/column/manual/manual-for-locotranslate/" class="post-item-horizon">
  <div class="post-item-horizon__figure">
    <figure>
              <img src="https://brandnew.work/wp-content/uploads/manual-for-locotranslate-150x150.png" loading="lazy" alt="loco Transiateの使い方について" width="75" height="75">
          </figure>
  </div>
  <div class="post-item-horizon__contents">
    <h3 class="post-item-horizon__title">loco Transiateの使い方について</h3>
    <div class="post-item-vertical__meta">
      <div class="post-item-vertical__category">
                <object><a href="https://brandnew.work/column/category/manual/">Manual</a></object>
      </div>
      <div class="post-item-vertical__time">
        <time datetime="2023-10-02">2023.10.02</time>
      </div>
    </div>
  </div>
</a>

<a href="https://brandnew.work/column/wordpress/woocommerce-custom_post_type_permalinks-single-error/" class="post-item-horizon">
  <div class="post-item-horizon__figure">
    <figure>
              <img src="https://brandnew.work/wp-content/uploads/woocommerce-custom_post_type_permalinks-single-error-150x150.png" loading="lazy" alt="Woocommerce + Custom Post Type Permalinksで商品詳細が表示されなくて困った話" width="75" height="75">
          </figure>
  </div>
  <div class="post-item-horizon__contents">
    <h3 class="post-item-horizon__title">Woocommerce + Custom Post Type Permalinksで商品詳細が表示されなくて困った話</h3>
    <div class="post-item-vertical__meta">
      <div class="post-item-vertical__category">
                <object><a href="https://brandnew.work/column/category/wordpress/">Wordpress</a></object>
      </div>
      <div class="post-item-vertical__time">
        <time datetime="2023-09-09">2023.09.09</time>
      </div>
    </div>
  </div>
</a>

<a href="https://brandnew.work/column/wordpress/wp-rest-api_urlsearchparams__embedded/" class="post-item-horizon">
  <div class="post-item-horizon__figure">
    <figure>
              <img src="https://brandnew.work/wp-content/uploads/wp-rest-api_urlsearchparams__embedded-150x150.png" loading="lazy" alt="WP REST APIでURLSearchParams使用時に_embeddedで詰まった話" width="75" height="75">
          </figure>
  </div>
  <div class="post-item-horizon__contents">
    <h3 class="post-item-horizon__title">WP REST APIでURLSearchParams使用時に_embeddedで詰まった話</h3>
    <div class="post-item-vertical__meta">
      <div class="post-item-vertical__category">
                <object><a href="https://brandnew.work/column/category/wordpress/">Wordpress</a></object>
      </div>
      <div class="post-item-vertical__time">
        <time datetime="2025-01-15">2025.01.15</time>
      </div>
    </div>
  </div>
</a>

<a href="https://brandnew.work/column/wordpress/acf-trouble-for-admin/" class="post-item-horizon">
  <div class="post-item-horizon__figure">
    <figure>
              <img src="https://brandnew.work/wp-content/uploads/acf-trouble-for-admin-150x150.png" loading="lazy" alt="ACFの入力欄が管理画面に表示されない場合に確認したいこと" width="75" height="75">
          </figure>
  </div>
  <div class="post-item-horizon__contents">
    <h3 class="post-item-horizon__title">ACFの入力欄が管理画面に表示されない場合に確認したいこと</h3>
    <div class="post-item-vertical__meta">
      <div class="post-item-vertical__category">
                <object><a href="https://brandnew.work/column/category/wordpress/">Wordpress</a></object>
      </div>
      <div class="post-item-vertical__time">
        <time datetime="2023-09-16">2023.09.16</time>
      </div>
    </div>
  </div>
</a>
    </div>
  </div>
  <div class="widget sidebar-toc"><div id="ez-toc-widget-container" class="ez-toc-widget-container ez-toc-v2_0_89 ez-toc-widget counter-hierarchy ez-toc-widget-container ez-toc-affix ez-toc-widget-direction">

					<h2>                                        <span class="ez-toc-title-container">
                                        <style>
                                    		#ezw_tco-2 .ez-toc-title{
                                    		    font-size: 120%;
												;
												;
                                    		}

											#ezw_tco-2 .ez-toc-widget-container ul.ez-toc-list li a{
												;
												;
												;

											}
                                            #ezw_tco-2 .ez-toc-widget-container ul.ez-toc-list li.active{
                                                    background-color: #ededed;
                                            }
                                        </style>
																				<span class="ez-toc-title-toggle">
                                            
												<span class="ez-toc-title" >Contents</span>



                                                                                        </span>
                                        </span>

					</h2>                                        					<nav>
<ul class='ez-toc-list ez-toc-list-level-1' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class="ez-toc-link ez-toc-heading-1" href="#%e5%89%8d%e6%8f%90" >前提</a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class="ez-toc-link ez-toc-heading-2" href="#%e7%92%b0%e5%a2%83" >環境</a></li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class="ez-toc-link ez-toc-heading-3" href="#%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%9f%e3%83%a9%e3%82%a4%e3%83%96%e3%83%a9%e3%83%aa" >使用したライブラリ</a></li></ul></li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class="ez-toc-link ez-toc-heading-4" href="#%e5%87%a6%e7%90%86%e3%81%ae%e9%a0%86%e5%ba%8f" >処理の順序</a></li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class="ez-toc-link ez-toc-heading-5" href="#ruby%e5%81%b4%e3%81%ae%e5%87%a6%e7%90%86" >Ruby側の処理</a></li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class="ez-toc-link ez-toc-heading-6" href="#selenium%e3%81%ae%e5%87%a6%e7%90%86" >Seleniumの処理</a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class="ez-toc-link ez-toc-heading-7" href="#%e3%83%ad%e3%82%b0%e3%82%a4%e3%83%b3%e5%87%a6%e7%90%86" >ログイン処理</a></li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class="ez-toc-link ez-toc-heading-8" href="#%e6%8c%87%e5%ae%9a%e5%b9%b4%e3%81%ae%e8%b3%bc%e5%85%a5%e5%b1%a5%e6%ad%b4%e3%83%9a%e3%83%bc%e3%82%b8%e3%81%b8%e7%a7%bb%e5%8b%95" >指定年の購入履歴ページへ移動</a></li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class="ez-toc-link ez-toc-heading-9" href="#%e9%a0%98%e5%8f%8e%e6%9b%b8%e3%81%ae%e5%8f%96%e5%be%97" >領収書の取得</a></li></ul></li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class="ez-toc-link ez-toc-heading-10" href="#%e3%83%95%e3%82%a1%e3%82%a4%e3%83%ab%e5%90%8d%e3%82%92%e5%a4%89%e6%9b%b4" >ファイル名を変更</a></li></ul></nav>
</div>
</div>  <div class="toc-toggle">
    <div class="toc-toggle__btn">
      <span class="toc-toggle__btn--icon"></span>
      <span class="toc-toggle__btn--label">TOC</span>
    </div>
  </div>
</aside>
</div>
  </div>


  <!-- .common-portfolio -->
          <section class="common-portfolio">
        <div class="inner over">
          <header class="content-header">
            <h2 class="title__main" number="02" data-aos="fade-left">portfolio</h2>
          </header>
          <div class="common-portfolio__contents">
            <div class="common-portfolio__left">
                              <div class="common-portfolio__description" data-aos="fade-left" data-aos-delay="250">
                  <p>ポートフォリオは現在、パスワードロックをかけさせていただいております。</p>
                  <p>閲覧されたい方はフォームよりパスワードの請求をお願いいたします。</p>
                </div>
                <div class="common-portfolio__btn" data-aos="fade-left" data-aos-delay="250">
                  <a href="https://brandnew.work/portfolio" class="btn-circle"><span></span>more portfolio</a>
                </div>
                          </div>
            <div class="common-portfolio__right">
              <div id="portfolioSlider" class="portfolioSlider splide" data-aos="fade-left" data-aos-delay="500">
                                  <div class="splide__track">
                    <ul class="splide__list">
                                              <li class="splide__slide">
                          <error>
    <code>internal_server_error</code>
    <title><![CDATA[WordPress &amp;rsaquo; エラー]]></title>
    <message><![CDATA[&lt;p&gt;このサイトで重大なエラーが発生しました。&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;https://ja.wordpress.org/support/article/faq-troubleshooting/&quot;&gt;WordPress のトラブルシューティングについてはこちらをご覧ください。&lt;/a&gt;&lt;/p&gt;]]></message>
    <data>
        <status>500</status>
    </data>
</error></body>