• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

Issues when trying to access and save a webpage

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to connect to a website using jsoup, a document object makes the connection and an element object saves its content. I have tested all the code locally (I saved the site's code in a html file in my localhost) and everything worked. But when I try to do the same thing on the web, the response is a page with CRC content.

This is the code I'm using to make the connection.

The object client is an object I made for retrieving data from a data base (numbers - integer), the same for comarca.

This is the page I get:


I'm so sorry for the long post, but I'm going crazy. I can't figure out what is going on. Thanks for any help.
 
Sheriff
Posts: 24654
58
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It looks like that URL returns what you posted there. If a browser received that data, it would recognize that there was Javascript in it, and it would handle it accordingly. That would involve calling the test() function, since that's what the "onload" attribute of the <body> element says to do. And that function does some cryptic fiddling about and submits a form, which presumably returns what you see when you use a browser for that URL.

My opinion is that all of that cryptic Javascript is there to prevent the casual hacker from accessing the data in the way you're trying to do. Perhaps you should contact the owner of the site and ask if there's some better way of accessing its data?
 
a wee bit from the empire
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!