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 3399878
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T04:49:28+00:00 2026-05-18T04:49:28+00:00

NOTE : edited by @drachenstern, and I don’t mind removing my answer on account

  • 0

NOTE: edited by @drachenstern, and I don’t mind removing my answer on account of this. The OP is Russian (I believe) Ukrainian (with my apologies) and is having an ESL issue describing his problem. Between the two HRs is his original post.


order that would make getElementsByTagName (“s”); and give value = ‘2d331be47563423424abdb7fe2eee6401c7b00417’

my string:

<html>
  <head>
    <meta http-equiv='content-type' content='text/html; charset=windows-1251' />
  </head>
  <body onload="try { document.getElementById('l').submit(); } catch(e) { document.getElementsByTagName('form')[0].submit(); }">
    <form id='l' method='post' action='http://vkontakte.ru/login.php'>
      <input type='hidden' name='s' value='2d331be47563423424abdb7fe2eee6401c7b00417' />
            <input type='hidden' name='op' value='slogin' />
      <input type='hidden' name='redirect' value='1' />
      <input type='hidden' name='expire' value='0' />
      <input type='hidden' name='to' value='' />
    </form>
  </body>
</html>

I need Convert String to DOM model order that would make parsing

I write this is my String in Java!

String mystr = "<html....</html>";

Russian – “У меня есть строка в JAVA она содержит в себе html файл(страницу сайта). Мне нужна функция которая достанет value в input. Я знаю что это можно прекрасно сделать через DOM модель, но у меня не получается это сделать.”

DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
InputSource is = new InputSource( new StringReader( body ) );
Document d = builder.parse( is );
String ss = d.getElementById("s").getNodeValue(); //- null

He understands the way to parse for an element in Javascript is via something like getElementsByTagName('s'); and he wants to find the equivalent way to do this in Java. He doesn’t know what library he needs. For what it’s worth, I don’t write Java either. He can only explain one metaphor with another tho.

Google translates his Russian request as:

I have a string in JAVA it contains
the html file (page). I need a
function that would get value in the
input. I know that this can be done
well through the DOM model, but I did
not get to do it.

  • 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-05-18T04:49:29+00:00Added an answer on May 18, 2026 at 4:49 am

    If your HTML string will not be any more complicated than this, then the easiest solution is just to parse with a Regular Expression, like

    name='s' value='(.*?)'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Note: Originally this question was asked for PostgreSQL, however, the answer applies to almost
(Note: This post has been edited to show specific use case. See bottom.) I
Note: I edited this question to make it easier for other people with the
[Editor's note: I have edited the title to try to make this useful to
Moderator note: This question is not a good fit for our question and answer
NOTE: EDITED The real-world situation is a series of events that each have two
NOTE: XMLIgnore is NOT the answer! OK, so following on from my question on
Note: This was posted when I was starting out C#. With 2014 knowledge, I
Note : The code in this question is part of deSleeper if you want
(Note: This is for MySQL's SQL, not SQL Server.) I have a database column

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.