How to make a web browser in Python

How to make a web browser in Python
0

#1

How can you make a web browser in Python in Windows 10 64 bit?


#2

That’s a tall order. Why would you want to do such a thing?

If you want this to be a desktop browser, you’ll need to pick a GUI library/framework first. Here’s a list to choose from. I don’t know which one works best or is easiest to learn.

The business side of the code is more straightforward. Python can easily make HTTP requests, so once you have a way for the user to input a FQDN, you can fetch the index.html page from that location and parse it. Once you have the HTML, you’ll have to parse it. Since Python has a library for everything, this will also be strightforward. When you’ve parsed the page, you can go out and fetch the linked files as needed. CSS is next, and it seems that’s a solved problem as well. If you want to be able to execute JavaScript, you’ll probably want to use an open source engine like ChakraCore or v8, otherwise you’ll have to build your own. Maybe that’s what you want to do. No judgement here. Once you have everything fetched are parsed, you’ll have to work on rendering. This means being able to render the position, color, shape, and (possibly) animations according to the code and browser specifications.

This is an abbreviation of a summary of an idea. A web browser could be something as simple as Lynx or complicated as Firefox, so get an idea of what you want this thing to do and how well you want to make it before writing your first line of code.


#3

I wanna make a program that give you internet like a google net give you.


#4

Do you have any programming experience? How much of the curriculum have you done?


#5

Wow man chill it was just a question.


#6

@PortableStick is just trying to understand what level of background you have in order to provide you the most relevant answer to your question.


#7

It wasn’t an attack, I was just curious where you are in your programming journey. You’ve asked about a few very complicated topics on the forums, and that’s totally cool, but the first step is always to master the basics.


#8

We’re chill, just a little shocked.

It would be like saying, “I want to build a rocket ship. How do I do it?”

You’re asking a very complicated question and it sounds like you don’t quite understand what is involved. Portable gave a very detailed answer. He was also trying to understand how much you know to better help you.

It sounds like an interesting problem, but of course you’re never going to be able to compete with standard browsers. And (to the best of my knowledge) most browsers are written in lighter and faster languages like C and C++. I’m user it could be done in Python, but it is not going to be a great browser, IMHO.