擅长:python、mysql、java
<p>你就快到了。。。在</p>
<pre><code>import requests
import time
from selenium import webdriver
def google_play_download(app_page_id):
browser = webdriver.Chrome()
browser.get("https://apps.evozi.com/apk-downloader/?id=" + app_page_id)
browser.find_element_by_css_selector(".btn.btn-primary.btn-lg.btn-block").click()
time.sleep(10)
apk_link = browser.find_element_by_css_selector(".btn.btn-success.btn-block").get_attribute('href')
browser.quit()
for rnd in range(5):
resp = requests.get(apk_link)
if resp.headers['Content-Length'] == str(len(resp.content)):
return resp.content
if __name__ == "__main__":
content = google_play_download("com.instagram.android")
f = open('file.apk', 'wb')
f.write(content)
f.close()
</code></pre>