🔒 Locked
Creating a basic web browser
Advertisement
Original Post
It depends on what you want to learn. Are you trying to learn what data passes between the client/server? Use some sort of socket, not a library to do it for you. Are you trying to learn how to display HTML? Then again, don't use a library for it.
I'm not sure what aspects you're trying to get a learning experience out of. That should really make up your mind whether you should parse HTML and such, as you asked.
I'm not sure what aspects you're trying to get a learning experience out of. That should really make up your mind whether you should parse HTML and such, as you asked.
You'll need to familiarize yourself with RFC 2616 - Hypertext Transfer Protocol -- HTTP/1.1. You also might want to go to rfc-editor.org and do a search for HTTP and HTML to turn up some more relevant RFCs.
Quote:
Original post by Sfpiano
I guess I start with parsing html. My question is how I'd start that, the actual process of turning html into something on screen.
I'm by no means trying to bash you, but if you dont atleast have a vague idea of where to begin then I believe your being a little to ambitious. I only say this because a few years ago when I was first learning windows api I thought the same thing. I quickly learned it was out of my current scope, so I worked on smaller less ambitious projects. Now I have a partially complete html parsing class. Only partially complete because I only work on it like once a month if that. :D I have been working on my own game engine primarily.
There are really two basic ways of doing this
1. The easy way:
Create an application which embeds Gecko (from Mozilla), MSHTML (Ships with Windows; part of MSIE) or KHTML / Applewebkit (Used in Konqueror / Safari). There are other less well known HTML rendering engines around, but they're generally not as good.
2. The hard way:
Parse the HTML and write your own layout engine, your own CSS engine etc. Embed an existing javascript engine (if desired). <br/><br/>This will be enormously difficult. You can get existing HTML parsers (I'm using the libxml2), but I've drawn a blank with a usable embeddable CSS interpreter (i.e. something which can read CSS and then tell me what styles apply to a given element for rendering)<br/><br/>Mark
1. The easy way:
Create an application which embeds Gecko (from Mozilla), MSHTML (Ships with Windows; part of MSIE) or KHTML / Applewebkit (Used in Konqueror / Safari). There are other less well known HTML rendering engines around, but they're generally not as good.
2. The hard way:
Parse the HTML and write your own layout engine, your own CSS engine etc. Embed an existing javascript engine (if desired). <br/><br/>This will be enormously difficult. You can get existing HTML parsers (I'm using the libxml2), but I've drawn a blank with a usable embeddable CSS interpreter (i.e. something which can read CSS and then tell me what styles apply to a given element for rendering)<br/><br/>Mark
It would certainly be a good project to learn many aspects of programming; networking, graphical interface, optimal data structure etc. etc. Good luck with that!
If you're planning on making it standards compliant there is an awful lot of reading to do first. The CSS and XHTML specs are pretty big.
If you're planning on making it standards compliant there is an awful lot of reading to do first. The CSS and XHTML specs are pretty big.
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement