Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8001627
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T16:08:21+00:00 2026-06-04T16:08:21+00:00

I have a problem.. I want to download to XML some info from website

  • 0

I have a problem..
I want to download to XML some info from website ( this I know how to do ), i know how to dl info from website but problem is when first
i need to log in.

Its part of code:

 <form method="post" action="logowanie.php">
  <table class="center">
   <tr>
    <td><label for="username">Login:</label></td>
    <td><input type="text" name="username" value=""></td>
    <td rowspan="2"><div class="submit"><input type="submit" value="OK" name="submit"></div></td>
   </tr>
   <tr>
    <td><label for="password">Hasło:</label></td>
    <td><input type="password" name="password" value=""></td>

I need to some how enter username password and press button submit.
Any ideas , code samples how to do it ?
Thanks very much.

Im doing it in Java/Scala.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T16:08:22+00:00Added an answer on June 4, 2026 at 4:08 pm

    While the Apache HttpClient would work, using it from Scala is unidiomatic and verbose, and the Dispatch library provides a nice Scala wrapper that lets you write much more concise code. You could use it like this:

    import dispatch._
    
    val u = url("https://site.com/logowanie.php")
    val info = Seq("username" -> "me", "password" -> "secret")
    
    val client = new Http
    client(u << info >>> System.out)
    

    This example would simply print the response, but you can easily provide more sophisticated ways of handling the response, and your client now holds the cookies you need to continue interacting with the site.

    Here’s a more complex example that I’ve used to log in to a system that required me to pick up a generated identifier from the form before logging in:

    import dispatch._
    import dispatch.jsoup.JSoupHttp._
    
    val u = url("https://myuni.edu/something/login")
    val info = Seq(
      "username"  -> "me",
      "password"  -> "secret",
      "warn"      -> "true",
      "submit"    -> "LOGIN",
      "execution" -> "e1s1",
      "_eventId"  -> "submit"
    )
    
    val client = new Http
    val id = client(u </> (_.select("input[name=lt]").first.attr("value")))
    client(u << info :+ ("lt" -> id) >>> System.out)
    

    Here I’m using Dispatch’s JSoup support to parse the form page and pull out the identifier I need, which I can then add to the form parameters when I submit the request.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this kind of problem where I want to download some images that
I have this problem: I want to generate a new source code file from
I have problem, when I want add Node to my GUI from other Thread.
I want to place UItextField in UITableViewCell but I have problem. Text field don't
I want to download SnortRules from command line but when I put it with
I have used HTTRACK to download Federal regulations from a government website, and the
I know this question would have been asked several time but still I am
i have an exe url that i want to download after 2 sec from
I want to use Rapidshare api for my website, and I have the problem.
I have the XML given below. From this XML, in an ASPX page with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.