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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T11:08:23+00:00 2026-05-13T11:08:23+00:00

I am writing a screen scraping app that reads out various pages and extracts

  • 0

I am writing a screen scraping app that reads out various pages and extracts the data. I’m using the SAXParserFactory go get a SAXParser which in turn gets me an XMLReader. I have configured the Factory like this:

spf = SAXParserFactory.newInstance();
spf.setValidating(false);
spf.setFeature("http://xml.org/sax/features/validation", false);
spf.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
spf.setFeature("http://xml.org/sax/features/use-entity-resolver2", false);

However, whenever I parse a document that contains the &nbsp entity I get an

SEVERE: null
    org.xml.sax.SAXParseException: The
    entity "nbsp" was referenced, butnot declared.
            at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1231)
            at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)

I can understand that it can’t find the entity, since I told the factory to not read the DTD, but how do I disable entity checking alltogther?

EDIT: This is for an Android app, which is why I am reluctant to use an API/library that isn’t in the standard environment.

  • 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-13T11:08:24+00:00Added an answer on May 13, 2026 at 11:08 am

    SAX doesn’t seem capable of this, but the StAX API does. See this previous question/answer for how to set this up.

    If you’re writing the XML processor by hand, the StAX API is a lot easier to deal with than the SAX API, so you win on both counts.

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

Sidebar

Related Questions

So I'm writing an application that will do a little screen scraping. I'm using
I am writing a little screen-scraping app that consumes some XHTML - it goes
i am writing a program that requires me to scrape data from the screen,
I just create a app for writing the text on Screen using TouchEvent method.
I'm writing a screen saver type app that needs to stop the user from
I'm writing a stored procedure that gets data for a whole screen. How can
I'm writing a site that is going to rely a lot on screen scraping.
I'm currently writing a screen capture app for Windows and Linux using PyGTK, and
I'm writing an Android app in Eclipse, and displaying some text on screen using
I am writing a basic screen scraping script using Mechanize and BeautifulSoup (BS) in

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.