facundoolano / app-store-scraper

scrape data from the itunes app store
MIT License
1.03k stars 244 forks source link

Unexpected token, cannot get reviews #208

Open LrDaniel opened 21 hours ago

LrDaniel commented 21 hours ago

Getting an "Unexpected token < in JSON at position 0" when trying to get reviews

checking the response from the itunes url
const url = https://itunes.apple.com/${opts.country}/rss/customerreviews/page=${opts.page}/id=${id}/sortby=${opts.sort}/json; im getting this HTML :

 <body onload="return its.detect.openItunes('https://itunes.apple.com/us/store?ign-mscache=1');">

  <!-- InternetExplorer ActiveX Component (must have non-zero width/height!) -->
  <object classID="CLSID:D719897A-B07A-4C0C-AEA9-9B663A28DFCB" width="1" height="1" id="iTunesDetectorIE" ></object>
   <div id="loadingbox-wrapper">
   <div class="loadingbox">
      <p class="title">Connecting to the iTunes Store.<span id="loading-dots">..</span></p>

       <div class="clear"></div>

         <!-- User Override Panel.
            By default, we show this panel so users with javascript disabled can click through
            to the store.  If javascript is enabled, the code snippet at the bottom of the div
            will hide the panel. AFTER that, if the check for iTunes yields indeterminate results,
            this panel will be unhidden by the script in itmsCheck.js.
            Don't change the id of this div; it's used by itmsCheck.js
          -->
         <div id="itunes-client-required" style="display:block;">
          <center><br>
           <p style="color: red;">
            We are unable to find iTunes on your computer.
           </p><br>
            <a onclick="its.detect.userOverrideSetItunesInstalled(); its.detect.openItunes(); return true;" href="#">
             <input type="submit" value="I have iTunes" />
            </a>
           <a href="http://www.apple.com/itunes/download/?itunesInstalled=unknown"><input type="submit" value="Download iTunes" /></a>
          </center>
          <script type="text/javascript">
            document.getElementById('itunes-client-required').style.display='none';
          </script>
         </div>
         <!-- End user override panel -->

      <p class="footer">If you don't have iTunes, <a href="http://www.apple.com/itunes/download/">download it for free</a>. If you have iTunes and it doesn't open automatically, try opening it from your dock or Windows task bar.</p>
   </div></div>
  </body>
LrDaniel commented 21 hours ago
  • Operating System: macOS 15
  • Node version: 18.20
  • app-play-scraper version: 0.18.0

Getting an "Unexpected token < in JSON at position 0" when trying to get reviews

checking the response from the itunes url const url = https://itunes.apple.com/${opts.country}/rss/customerreviews/page=${opts.page}/id=${id}/sortby=${opts.sort}/json; im getting this HTML :

<body onload="return its.detect.openItunes('https://itunes.apple.com/us/store?ign-mscache=1');">

 <!-- InternetExplorer ActiveX Component (must have non-zero width/height!) -->
 <object classID="CLSID:D719897A-B07A-4C0C-AEA9-9B663A28DFCB" width="1" height="1" id="iTunesDetectorIE" ></object>
  <div id="loadingbox-wrapper">
  <div class="loadingbox">
     <p class="title">Connecting to the iTunes Store.<span id="loading-dots">..</span></p>

      <div class="clear"></div>

        <!-- User Override Panel.
           By default, we show this panel so users with javascript disabled can click through
           to the store.  If javascript is enabled, the code snippet at the bottom of the div
           will hide the panel. AFTER that, if the check for iTunes yields indeterminate results,
           this panel will be unhidden by the script in itmsCheck.js.
           Don't change the id of this div; it's used by itmsCheck.js
         -->
        <div id="itunes-client-required" style="display:block;">
         <center><br>
          <p style="color: red;">
           We are unable to find iTunes on your computer.
          </p><br>
           <a onclick="its.detect.userOverrideSetItunesInstalled(); its.detect.openItunes(); return true;" href="#">
            <input type="submit" value="I have iTunes" />
           </a>
          <a href="http://www.apple.com/itunes/download/?itunesInstalled=unknown"><input type="submit" value="Download iTunes" /></a>
         </center>
         <script type="text/javascript">
           document.getElementById('itunes-client-required').style.display='none';
         </script>
        </div>
        <!-- End user override panel -->

     <p class="footer">If you don't have iTunes, <a href="http://www.apple.com/itunes/download/">download it for free</a>. If you have iTunes and it doesn't open automatically, try opening it from your dock or Windows task bar.</p>
  </div></div>
 </body>
brunnoandradegok commented 15 hours ago

I have the same problem.