Results 1 to 3 of 3
  1. #1
    peachy is offline Member
    Join Date
    Dec 2012
    Posts
    6
    Rep Power
    0

    Default reading HTML on website

    Hi,

    I am currently writing a program that reads information in from certain websites.

    I have looked at two ways of doing this: (1) Using Jsoup and (2) using URLconnection.

    When I access a particular website, the URLconnection can parse the HTML fine (its just slower), whereas Jsoup seems to come up with 403 forbidden errors on particular websites (however, it works perfectly fine with websites such as google.com etc).

    There are no errors in the code, so I'm not looking for a fix currently. I am just wondering why Jsoup will get a forbidden connection with particular websites whereas the java.net.URLConnection allows access to the exact same site without being forbidden?

    Cheers
    Peachy

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,189
    Rep Power
    19

    Default Re: reading HTML on website

    Moved from New to Java

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    Steve11235's Avatar
    Steve11235 is offline Senior Member
    Join Date
    Dec 2008
    Posts
    1,046
    Rep Power
    7

    Default Re: reading HTML on website

    Your question is a good example of a reason to write your own code. You know exactly what it is doing. Frameworks are fine, as long as you use them for their intended purpose. Sounds like you are getting outside theirs.
    The Java Tutorial. Read it.

Similar Threads

  1. Problems Reading HTML
    By beijct in forum New To Java
    Replies: 2
    Last Post: 10-11-2012, 09:47 AM
  2. Creating a SIMPLE Java APPLET for a HTML website
    By JimmySmith in forum Java Applets
    Replies: 2
    Last Post: 03-02-2012, 10:26 PM
  3. Replies: 1
    Last Post: 12-17-2010, 09:22 AM
  4. Replies: 0
    Last Post: 10-09-2009, 10:27 PM
  5. Placing java code/html pages on website host
    By Bomber_Will in forum New To Java
    Replies: 8
    Last Post: 11-30-2008, 04:31 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •