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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T01:15:05+00:00 2026-05-16T01:15:05+00:00

I have to check the differences between two html pages: One is an old

  • 0

I have to check the differences between two html pages: One is an old version and the other is the updated page.

I need Selenium to get the source of the two pages and then compare them to check the differences.

How can I achieve this using Java & Selenium?

Below is the flow I have:

  • Go to the old page using Selenium
  • Collect all the data for the old web page
  • Convert the data to a standard format (XML probably); create a class
    to do this
  • Save the data to a file
  • Go to the new page using Selenium
  • Collect all the data for the new web page
  • Convert the data to a standard format (XML probably); use the class
    you created to do this
  • Save the data to a file
  • Use a Java library to diff the two files

Can anyone give ideas/examples in how to implement this?

  • 1 1 Answer
  • 3 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-16T01:15:06+00:00Added an answer on May 16, 2026 at 1:15 am

    Use selenium.getHtmlSource() for each page and either compare the returned Strings in Java or save them to files and use a command line tool such as “diff”.

    If using Java, two methods I can think of are using something like StringUtils.difference() (almost certainly a mess) or better yet Google Diff. Google diff has a Java library and test example.

    Of course the outputs of these will be a literal diff, you might want something more custom to make sense of changes in HTML.

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

Sidebar

Related Questions

i have two options One <%= Html.CheckBox(postType, false, new { @id = item.int_PostTypeId.ToString() })%>
I'm needing to check the differences between two XMLs but not blindly, Given that
i have created below function to get date difference between two dates.. pleas check
I have one method, check which has two hashmaps as parameters. Keys of these
INSERT MODE i have check box in one tr. and another dropdown control in
Possible Duplicate: How to calculate the difference between two dates using PHP? I have
I'm trying to determine the differences between two collections. private ObservableCollection<SomeObject> _objectList = null;
How to check for HTML 5 localStorage compability of the users browser? I have
We have a project here which is split into two. One for Internal and
I have two arrays, one looks like: [ssewweewewzad0xsis, sasasaasasaas, ddwdwd, ffdfdfdffdfdf, rffrfrfrfrfrrf, rffrfrfrffrfrfrfbyzad0xsis ,

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.