<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: adewaleng</title>
    <description>The latest articles on DEV Community by adewaleng (@adewaleng).</description>
    <link>https://dev.to/adewaleng</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F970581%2F12d3c410-25fd-4442-b628-7d4a153d786b.png</url>
      <title>DEV Community: adewaleng</title>
      <link>https://dev.to/adewaleng</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/adewaleng"/>
    <language>en</language>
    <item>
      <title>How to Crawl Android APK from apkpure</title>
      <dc:creator>adewaleng</dc:creator>
      <pubDate>Fri, 11 Nov 2022 08:10:18 +0000</pubDate>
      <link>https://dev.to/adewaleng/how-to-crawl-android-apk-from-apkpure-1h60</link>
      <guid>https://dev.to/adewaleng/how-to-crawl-android-apk-from-apkpure-1h60</guid>
      <description>&lt;p&gt;The article will guide you to quickly crawl and download Android applications from the &lt;a href="https://m.apkpure.com/"&gt;apkpure&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The factors important for that are
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Browser (such as Chrome)&lt;/li&gt;
&lt;li&gt;NodeJS (&lt;a href="https://nodejs.org/en/download/"&gt;install&lt;/a&gt;)&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Analysis web page
&lt;/h2&gt;

&lt;p&gt;Select an application from the &lt;a href="https://m.apkpure.com/"&gt;home page&lt;/a&gt; to enter the download page. For example, I select &lt;a href="https://m.apkpure.com/fifa-soccer/com.ea.gp.fifamobile/download?from=details"&gt;this page&lt;/a&gt; and use F12 shortcut to open the console. Select the download button to see the download link of the application.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--AGGCi_Wo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/426e1d99gho9ghoubxc4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--AGGCi_Wo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/426e1d99gho9ghoubxc4.png" alt="download url" width="880" height="381"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Access this &lt;a href="https://d.apkpure.com/b/APK/com.ea.gp.fifamobile?version=latest"&gt;link&lt;/a&gt; to download the latest version of the application.&lt;/p&gt;

&lt;p&gt;If you want to download other packages, you only need to download and modify the package name in the link:&lt;br&gt;
&lt;code&gt;https://d.apkpure.com/b/APK/{PACKAGE_NAME}?version=latest&lt;/code&gt;&lt;br&gt;
If you want to download other versions of packages, you can specify the version code:&lt;br&gt;
&lt;code&gt;https://d.apkpure.com/b/APK/{PACKAGE_NAME}?versionCode={VERSION_CODE}&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Other information about the package can be obtained through another page, such as version number, developer, release date, etc.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--OKozgUZF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vlc0nlopzwb3ovhieavw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--OKozgUZF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vlc0nlopzwb3ovhieavw.png" alt="apk info" width="880" height="251"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We can also get all the historical versions of the application through the historical version page. It should be noted here that the file types are divided into XAPK and APK. XAPK requires a special installer to install on the device, so we only need APK files.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--HUhdVFY4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rlthsako8188nu9cedva.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--HUhdVFY4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rlthsako8188nu9cedva.png" alt="other versions" width="880" height="405"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Scraping APK through crawlers
&lt;/h2&gt;
&lt;h3&gt;
  
  
  1. Downloading APK
&lt;/h3&gt;

&lt;p&gt;We already know the assembly rules of the download link. We only need to download it through the package name. Enter the assembled download link (e. g. &lt;a href="https://d.apkpure.com/b/APK/com.ea.gp.fifamobile?version=latest"&gt;https://d.apkpure.com/b/APK/com.ea.gp.fifamobile?version=latest&lt;/a&gt;) into the browser to download it directly.&lt;/p&gt;

&lt;p&gt;However, if you want to download it outside the browser, you will be blocked by the Cloudflare. In order to avoid being blocked, we can use the js package puppeteer to simulate the browser's access behavior and download.&lt;/p&gt;
&lt;h3&gt;
  
  
  2. Scraping APK Details
&lt;/h3&gt;

&lt;p&gt;In order to prevent requests from being intercepted by Cloudflare, scraping APK details can also be implemented using puppeteer.&lt;/p&gt;

&lt;p&gt;For example, after opening the apkpure application details page, you can obtain the application details through the following program.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--nMMR5Jig--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cyhkbut1otidyu3yd5bt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--nMMR5Jig--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cyhkbut1otidyu3yd5bt.png" alt="code" width="880" height="512"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Obtained through the js package provided by the author
&lt;/h2&gt;

&lt;p&gt;If you think it is very troublesome to realize this ability, you can choose js package &lt;a href="https://www.npmjs.com/package/apkpure-crawler"&gt;apkpure-crawler&lt;/a&gt; provided by the author. The usage is also very simple:&lt;/p&gt;

&lt;p&gt;If you already have a NodeJS and npm, you can simply install the program to your computer through the following command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install -g apkpure-crawler
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This tool can provide the following abilities:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# get package download url with package name
apkcrawl get com.ea.gp.fifamobile

# download package with package name
apkcrawl down com.ea.gp.fifamobile

# crawler package info with package name
apkcrawl crawler com.ea.gp.fifamobile
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
  </channel>
</rss>
