2013-03-20 51 views

回答

1

那麼,我選擇了以下解決方案。 因爲我是一名.NET程序員,所以使用Java庫並不容易,而且我也沒有足夠的時間將它們重寫爲C#。

在史蒂芬·桑德森的博客,我發現無頭的瀏覽器自動化的文章(http://blog.stevensanderson.com/2010/03/30/using-htmlunit-on-net-for-headless-browser-automation/

這裏是我寫的代碼:

WebClient _webClient = new WebClient(BrowserVersion.FIREFOX_17); 
_webClient.getOptions().setUseInsecureSSL(true); 
_webClient.getOptions().setThrowExceptionOnScriptError(false); 
_webClient.getOptions().setRedirectEnabled(true); 

var page = (HtmlPage)_webClient.getPage("https://play.google.com/apps/publish/v2/"); 

HtmlInput emailElement = (HtmlTextInput)page.getElementById("Email"); 
emailElement.type(Settings.Default.Login); 

HtmlInput passwordElement = (HtmlInput)page.getElementById("Passwd"); 
passwordElement.type(Settings.Default.Password); 

HtmlSubmitInput signInLink = (HtmlSubmitInput)page.getElementById("signIn"); 
HtmlPage page2 = (HtmlPage)signInLink.click(); 

_webClient.waitForBackgroundJavaScript(2000); 

var installsNode = (from p in page2.getElementsByTagName("p").toArray().Cast<HtmlParagraph>() 
        let data_column = p.getAttribute("data-column") 
      where data_column != null && "INSTALLS".Equals(data_column, StringComparison.OrdinalIgnoreCase) 
      select p).FirstOrDefault(); 
2

發現看一看在GitHub上Andlytics項目。它也是Google Play上的開源應用程序。你會在鏈接的GitHub頁面上找到一個鏈接。

但是,它不是(目前)在Google Play商店上的一個特定應用程序。而是與您的開發者帳戶連接,並獲取有關使用相同方式發佈的每個應用程序的信息。

這就是說,既然它是開源的,我相信它可以調整以適應你的確切目的。

這裏還有一個非官方的API:https://code.google.com/p/android-market-api/。但快速查看源代碼表明,這不會更新/定期更新。

Andlytics另一方面是定期更新(以適應對Google Play商店所做的任何更改)。