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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T20:39:01+00:00 2026-06-13T20:39:01+00:00

Possible Duplicate: Why html source is different when I opened it from web browser

  • 0

Possible Duplicate:
Why html source is different when I opened it from web browser and read it in Java?

I have a question about parsing 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?

  • 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-13T20:39:03+00:00Added an answer on June 13, 2026 at 8:39 pm

    If the data shown in the website is javascript generated, you will have no way to get the data unless you implements javascript functionality in your java code.

    Second possibilities is the web server determine the data from the user-agent or the capabilities of the browser/fetcher.

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

Sidebar

Related Questions

Possible Duplicate: HTML Compress File Upload? I have complains from client that my website
Possible Duplicate: Strip html from strings in python While making a small browser like
Possible Duplicate: CSS: *html #id_name I have a simple CSS question. What's the difference
Possible Duplicate: Removing HTML from a Java String I am having a problem removing
Possible Duplicate: Sending HTML email from PHP I need to send an html mail
Possible Duplicate: How to parse and process HTML with PHP? I have HTML document
Possible Duplicate: php regexp: remove all attributes from an html tag $input = '<div
Possible Duplicate: Best way to find Browser type & version? In HTML/JavaScript, How can
Possible Duplicate: Decode HTML entities in Python string? I have a malformed string in
Possible Duplicate: Parsing HTML in Python i am newbie to python, i am using

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.