ProgramWindowJava

get source code from a website

Hey, anyone know how to get the source code from a particular website using java? I need to get the source code from a certain site and then do stuff to it...

any help would be greatly appreciated

Replay:get source code from a website
Well if you mean java application or applet source then the only way is to ask them for it (assuming they don't supply the source on their website).

Replay:get source code from a website
If on the other hand you just need the HTML code generated by the website (You know, the code send to the browser), you could just set up a HttpConnection and read the entire page through an inputstream of some sort.

Replay:get source code from a website
yeah, sorry i mean the HTML code, thanks ractoc ill look into it

Replay:get source code from a website
he means HttpUrlConnection

setDoOutput to true (you will be reading from it, hence it is outputting to you)

then getContent will give you the page

incidentally, i found HTTPUnit MUCH better for interacting with web pages

[Previous] Array program help
[Next] Online Game

Google


Java

Online Game
Upload 20MB File
ObjectOutputStream writing error
JDBC problem: NullPointerException
Writing a database
Declaring an array help
CMP and database connection problem
Need help with methods
Need help with this Code, please.
Threads
My first program.
memory address?
executable java file
Bitwise comparison?
Can't figure out Static Error?
Help!! using recursion to search an array
Encrypt / Decrypt homework help
Menus
help!!!!!!!!!!!!!!!
How to access JSpinner's JTextField?