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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T13:50:58+00:00 2026-06-09T13:50:58+00:00

I scoured this site for the last two days looking for a reason why

  • 0

I scoured this site for the last two days looking for a reason why this will not function properly! I am trying to get the workout of the day on crossfit.com, when I run the program it displays a white screen for a while then crashes. Please advise me on what is wrong here!!

public class MainActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    TextView tv = (TextView) findViewById(R.id.textView1);

    Document doc = null;
    try {
        doc = Jsoup.connect("http://www.crossfit.com").get();
    } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    Element content = doc.getElementsByClass("blogbody").first();
    System.out.println(content.text());
    tv.setText(content.text());
}
}

Logcat:

08-04 00:14:08.105: E/AndroidRuntime(339): FATAL EXCEPTION: main
08-04 00:14:08.105: E/AndroidRuntime(339): java.lang.OutOfMemoryError
08-04 00:14:08.105: E/AndroidRuntime(339):  at java.util.ArrayList.add(ArrayList.java:123)
08-04 00:14:08.105: E/AndroidRuntime(339):  at org.jsoup.nodes.Node.addChildren(Node.java:411)
08-04 00:14:08.105: E/AndroidRuntime(339):  at org.jsoup.nodes.Element.appendChild(Element.java:267)
08-04 00:14:08.105: E/AndroidRuntime(339):  at org.jsoup.parser.HtmlTreeBuilder.insertNode(HtmlTreeBuilder.java:204)
08-04 00:14:08.105: E/AndroidRuntime(339):  at org.jsoup.parser.HtmlTreeBuilder.insertEmpty(HtmlTreeBuilder.java:173)
08-04 00:14:08.105: E/AndroidRuntime(339):  at org.jsoup.parser.HtmlTreeBuilderState$7.process(HtmlTreeBuilderState.java:443)
08-04 00:14:08.105: E/AndroidRuntime(339):  at org.jsoup.parser.HtmlTreeBuilder.process(HtmlTreeBuilder.java:89)
08-04 00:14:08.105: E/AndroidRuntime(339):  at org.jsoup.parser.HtmlTreeBuilderState$15.anythingElse(HtmlTreeBuilderState.java:1197)
08-04 00:14:08.105: E/AndroidRuntime(339):  at org.jsoup.parser.HtmlTreeBuilderState$15.process(HtmlTreeBuilderState.java:1191)
08-04 00:14:08.105: E/AndroidRuntime(339):  at org.jsoup.parser.HtmlTreeBuilder.process(HtmlTreeBuilder.java:84)
08-04 00:14:08.105: E/AndroidRuntime(339):  at org.jsoup.parser.TreeBuilder.runParser(TreeBuilder.java:48)
08-04 00:14:08.105: E/AndroidRuntime(339):  at org.jsoup.parser.TreeBuilder.parse(TreeBuilder.java:41)
08-04 00:14:08.105: E/AndroidRuntime(339):  at org.jsoup.parser.HtmlTreeBuilder.parse(HtmlTreeBuilder.java:37)
08-04 00:14:08.105: E/AndroidRuntime(339):  at org.jsoup.parser.Parser.parseInput(Parser.java:30)
08-04 00:14:08.105: E/AndroidRuntime(339):  at org.jsoup.helper.DataUtil.parseByteData(DataUtil.java:101)
08-04 00:14:08.105: E/AndroidRuntime(339):  at org.jsoup.helper.HttpConnection$Response.parse(HttpConnection.java:469)
08-04 00:14:08.105: E/AndroidRuntime(339):  at org.jsoup.helper.HttpConnection.get(HttpConnection.java:147)
08-04 00:14:08.105: E/AndroidRuntime(339):  at com.example.lookingfor.MainActivity.onCreate(MainActivity.java:36)
08-04 00:14:08.105: E/AndroidRuntime(339):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
08-04 00:14:08.105: E/AndroidRuntime(339):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
08-04 00:14:08.105: E/AndroidRuntime(339):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
08-04 00:14:08.105: E/AndroidRuntime(339):  at android.app.ActivityThread.access$1500(ActivityThread.java:117)
08-04 00:14:08.105: E/AndroidRuntime(339):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
08-04 00:14:08.105: E/AndroidRuntime(339):  at android.os.Handler.dispatchMessage(Handler.java:99)
08-04 00:14:08.105: E/AndroidRuntime(339):  at android.os.Looper.loop(Looper.java:123)
08-04 00:14:08.105: E/AndroidRuntime(339):  at android.app.ActivityThread.main(ActivityThread.java:3683)
08-04 00:14:08.105: E/AndroidRuntime(339):  at java.lang.reflect.Method.invokeNative(Native Method)
08-04 00:14:08.105: E/AndroidRuntime(339):  at java.lang.reflect.Method.invoke(Method.java:507)
08-04 00:14:08.105: E/AndroidRuntime(339):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
08-04 00:14:08.105: E/AndroidRuntime(339):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
08-04 00:14:08.105: E/AndroidRuntime(339):  at dalvik.system.NativeStart.main(Native Method)
  • 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-09T13:51:00+00:00Added an answer on June 9, 2026 at 1:51 pm

    Well, .. Jsoup is not flawless. While it’s one-size-fits all downloads seem appealing you’re sometimes better off downloading the stream yourself.

    URL url = new URL("http://www.crossfit.com");
    url.openConnection();
    InputStream is = url.openStream();
    byte[] b = new byte[8192];
    int count;
    ByteArrayOutputStream os = new ByteArrayOutputStream();
    while ((count = is.read(b)) != -1) {
        os.write(b, 0, count);
    }
    is.close();
    doc = Jsoup.parse(os.toString("UTF-8"));
    

    It’s a pretty huge page – shitting out about 70k of HTML per pop is not going to sit well with a DOM-like model in any small memory print device. Loading it yourself could work .. on most devices.. otherwise – look into a streaming solution using TagSoup instead.

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

Sidebar

Related Questions

I've scoured Google and this site pretty extensively, and I must be missing something.
I've scoured StackOverflow and Google for an answer to this problem. I'm trying to
I have scoured the internet looking for a solution to this and I am
I have scoured the internet looking for an answer to this question and can't
There is probably a simple response to this, but I've scoured the net trying
I've scoured the Web looking for examples on how to do this. I've found
I have scoured this site among others for answers in getting OpenEntityManagerInViewFilter to work.
I scoured the web and could not find the exact code I'm looking for...
I have scoured the net for this question and have came up empty handed.
I have scoured Google for a tutorial to help with this but haven't been

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.