2016-04-03 43 views
2

我想在android studio中编写一个应用程序,在网站html中提交表单并解析结果的html页面。我对这种工作很陌生,我需要帮助。我曾与过去的Jsoup一起工作,但只是到了我可以连接到html和解析东西的地步。我是新来提交表单。以下是我想要与输入标签一起提交的网站HTML上的表单。Android网页搜索的结果

<form role="form" ng-submit="searchForm.$valid &amp;&amp; searchEircode()" name="searchForm" novalidate="" class="ng-pristine ng-invalid ng-invalid-required ng-valid-minlength"> 
 
     <div class="input-group"> 
 
     <input placeholder="Enter a full address or Eircode" class="form-control ng-pristine ng-invalid ng-invalid-required ng-valid-minlength ng-touched" ng-class="{formcontrolRequired:searchForm.$submitted &amp;&amp; !searchForm.$valid || InvalidEircode}" ng-model="searchQuery" name="searchQuery" required="" autocomplete="off" spellcheck="false" typeahead="address.address for address in getAutoCompleteAddresses($viewValue)" typeahead-on-select="onSelect($item, $model, $label)" typeahead-focus-first="true" focus="" ng-minlength="3" search-bar="" aria-autocomplete="list" aria-expanded="false" aria-owns="typeahead-64-7981"><ul class="dropdown-menu ng-isolate-scope ng-hide" ng-show="isOpen()" ng-style="{top: position.top+'px', left: position.left+'px'}" style="display: block;;display: block;" role="listbox" aria-hidden="true" typeahead-popup="" id="typeahead-64-7981" matches="matches" active="activeIdx" select="select(activeIdx)" query="query" position="position"> 
 
    <!-- ngRepeat: match in matches track by $index --> 
 
</ul> 
 
      <span class="input-group-btn" ng-class="{current:loading}"> 
 
      <input type="submit" value="Search" class="btn btn-default btn-search-bar" ng-disabled="loading"> 
 
      <div id="floatingCirclesG"> 
 
       <div class="f_circleG" id="frotateG_01"> </div> 
 
       <div class="f_circleG" id="frotateG_02"> </div> 
 
       <div class="f_circleG" id="frotateG_03"> </div> 
 
       <div class="f_circleG" id="frotateG_04"> </div> 
 
       <div class="f_circleG" id="frotateG_05"> </div> 
 
       <div class="f_circleG" id="frotateG_06"> </div> 
 
       <div class="f_circleG" id="frotateG_07"> </div> 
 
       <div class="f_circleG" id="frotateG_08"> </div> 
 
      </div> 
 
      </span> </div> 
 
     <!-- ngIf: searchForm.$submitted --> 
 
     <div class="error-message ng-binding ng-hide" ng-show="InvalidEircode"> 
 
      
 
     </div> 
 
     </form>

前进的任何方式将高度赞赏。

+0

什么是表单的动作参数值?有我们可以看到这种形式的网址吗? – Stephan

回答

0

如果您提供了网址,这会更容易。但无论如何它非常简单。只需打开浏览器的开发者工具,进入网络选项卡。

然后通常从浏览器提交表单,然后检查网络选项卡,查看浏览器发送的请求。在标题标签中,您将能够看到所有已发送的表单数据和服务器地址。

然后你只需要发送同样的事情与Jsoup :)

我已经张贴在提交使用Jsoup形式(登录)到网站的详细教程,检查出来here