• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

java.io.IOException: Server returned HTTP response code: 403 for URL:

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I read many questions here but did not find correct answer for me. Actually i am scrapping a secured SSL implemented webpage in Java but getting below error:

java.io.IOException: Server returned HTTP response code: 403 for URL: https://viewpackages.com

Below is my Java Code for scrapping HTTPS url


Kindly help me to scrapp secured HTTPS url in Java.
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
403 means Forbidden. Maybe the website requires you to log in before you are allowed to view the webpage. It's also possible that the website detects that you are not a regular browser (maybe by looking at the User-Agent header) and block you, because it doesn't want automated bots to be able to read the page.

If you need to log in, you'll have to do more in your program than just try to read from the page. It's most likely easier to program that using a library such as Apache HttpClient - Java's standard classes for reading webpages are quite underpowered and don't (easily) allow you to do things like logging in on a website.
 
reply
    Bookmark Topic Watch Topic
  • New Topic