Java机械化,无法在“文档”下找到form()方法

时间:2019-11-05 05:55:06

标签: java http-post jsoup httpurlconnection mechanize

我已使用以下进口声明:

public function store(Request $request)
    {
        ...
        $transaction_in->save();
        for($i=0; $i < count($request->device_brand_id); $i++){
         $tdin[] = array(
          'Transaction_in_id' => $transaction_in->id,
          'DeviceType_id' => $request->device_type_id[$i],
          'DeviceBrand_id' => $request->device_brand_id[$i],
          'spek_device' => $request->device_spec[$i],
          'harga_device' => $request->price[$i],
          'jumlah_device' => $request->amount[$i],
          'total_harga_device' => $request->total_price[$i]
        );
       }

      Transaction_in_detail::insert($tdin);

      $transaction_in->update(['idTransaction_in' => sprintf('TIN-%04d', $transaction_in->id)]);

      return redirect('/transactionsin')->with('success', 'Transaction success');
 }

但是

    import com.gistlabs.mechanize.*;
    import com.gistlabs.mechanize.document.html.form.Form;
    import com.gistlabs.mechanize.impl.MechanizeAgent;
    import com.gistlabs.mechanize.document.*;
    import com.gistlabs.mechanize.interfaces.document.Document;
与以下代码一起使用时会生成

我想通过填写登录凭据来登录网站。

Error:(31, 25) java: cannot find symbol
  symbol:   method form(java.lang.String)
  location: variable page of type com.gistlabs.mechanize.interfaces.document.Document

我想要有向页的html文档。登录后。 请让我知道我要去哪里错了。

我尝试了HttpUrlConnection以及Jsoup.connect()。data()。post() 手动传递标题并登录,但是没有任何效果。

0 个答案:

没有答案