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

  • Home
  • SEARCH
  • 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 8779673
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T19:51:15+00:00 2026-06-13T19:51:15+00:00

I have a question about parsering online html page. when I open html source

  • 0

I have a question about parsering online html page.

when I open html source from a web browser, I can see the data in there.

But when I read this html page from java. I can not reach the data.

after I saved this html file, and read it as local file,

then I am able to read the data from there.

I take eBay.com.au as a example.

//——–Example———

target web page
URL:http://www.ebay.com.au/sch/i.html?_trksid=p3907.m570.l1311&_nkw=imac+27&_sacat=0&_from=R40

Here is my Java code

import org.htmlcleaner.CleanerProperties;
import org.htmlcleaner.TagNode;
import org.htmlcleaner.HtmlCleaner;
import java.net.URL;


public class HtmlCleanerTest
{

    public static void main(String[] args) throws Exception
    {

        CleanerProperties props = new CleanerProperties();

        URL myURL = new URL("http://www.ebay.com.au/sch/i.html?_trksid=p3907.m570.l1311&_nkw=imac+27&_sacat=0&_from=R40");

        TagNode tagNode = new HtmlCleaner(props).clean(myURL);

        Object[] myNodes = tagNode.getElementsByAttValue("class", "s1", true, true);

        for(Object oNote : myNodes)
        {
            TagNode n = (TagNode) oNote;
            System.out.println(n.getText());

        }
    }
}

I can get each product price by using this code, but I expected to get sellers location info by using this. How do I do that?

//—RE-edited ——————————-

I have found a way to solv my question,
I posted it here for someone like me has same problem.
I am not saying it is best solution for this, but I hope it may give you a thought.
here it is.

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import java.util.List;;

public class Test{
    public static void main(String[] args)
    {
        WebDriver driver = new FirefoxDriver();
        driver.get("http://www.ebay.com.au/sch/i.html?scp=ce0&_sacat=0&_from=R40&_nkw=imac+27&_pppn=r1&_rdc=1");

        driver.findElement(By.id("e1-14")).click();

        driver.findElement(By.name("Stores")).click();
        driver.findElement(By.id("e1-3")).click();

        driver.quit();
    }
}

/————–
——END——-
————–
/

I came to here with one question, what if HTML File come with Javascript, How do we grab data from it with Javascript complete executed. I guess I am not very good questioner.

  • 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-13T19:51:17+00:00Added an answer on June 13, 2026 at 7:51 pm

    Probably the page has some JavaScript code that is executed by the browser and loads more data to the page, after the HTML has been loaded. Reading only the HTML with Java does not execute the JavaScript, hence additional data is not visible in the stream.

    Edit:
    A library like HtmlUnit may help in solving the common problem of loading Ajaxified Html pages to a certain degree: http://htmlunit.sourceforge.net/

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

Sidebar

Related Questions

Possible Duplicate: Why html source is different when I opened it from web browser
I have question about parsing in Html helper : I have sth like: @foreach
I have question about XSLT1.0. The task is to write out in HTML all
I have question about interpreting strings as packed binary data in C++. In python,
i have question about YAJLiOS parser... I have next json data : {{ body
I have a question about this formula from a book: EFW (cm,kg)= 10^(-1,7492+(0,166*BPD)+(0,046*AC)-(2,646*AC*BPD/1000)) The
I have a question about thread safety. From what I have been told, SimpleDateFormat
I have quick question about text parsing, for example: INPUT=a b c d e
I have question about clean thory in Python. When: @decorator_func def func(bla, alba): pass
I have question about normalization. Suppose I have an applications dealing with songs. First

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.