Coding A Simple Web Browser in Python

  Рет қаралды 97,328

NeuralNine

NeuralNine

Күн бұрын

Пікірлер: 141
@dany_fg
@dany_fg 4 ай бұрын
this is great for django/flask/fastapi based apps, as you can create a web window for the server without the user even realizing
@addledanorak8297
@addledanorak8297 3 жыл бұрын
Another great use case for this (This is what i do in my projects sometimes): You can use this for creating awesome looking UIs. Just write a simple flask app and run the two things simultaneously so that now you can use HTML/CSS for UI instead of Qt5. I personally love using HTML/CSS so i use this trick for creating complex UIs in projects. Without the buttons on the top (go back, reload etc), it just looks like a window of some usual software.
@robinferizi9073
@robinferizi9073 3 жыл бұрын
But how do you get your flask app on the window
@addledanorak8297
@addledanorak8297 3 жыл бұрын
7:16 Use the setUrl function and pass in the localhost url your flask app is running on
@robinferizi9073
@robinferizi9073 3 жыл бұрын
@@addledanorak8297 but how would you show other webpages? And how would you keep the url bar and whatnot there
@MrinmoyHaloi
@MrinmoyHaloi 3 жыл бұрын
@@robinferizi9073 you can do that with html and js
@addledanorak8297
@addledanorak8297 3 жыл бұрын
@Robin Ferizi what I meant was to use the browser as a window that can show your flask project so that u can use html and css for ui and it looks like a professional software. That's all
@dicember92
@dicember92 2 жыл бұрын
Man, I need to say thanks! I crashed my head for an entire day trying to make a simple UI to stream a local server network content for a local community. I tried with socket, but I couldn't resolve my problem. Watching your video I understood that I could make a non navigable-browser with PyQt5. So a huge thanks!!
@Sebas0173YT
@Sebas0173YT 2 жыл бұрын
help bro that said like 16 error who are by the importatipon
@dicember92
@dicember92 2 жыл бұрын
@@Sebas0173YT you should check for the error and name of the library (pyqt5) on stackoverflow. I had issues with one of the methods and I had to install a separate library, but I don’t remember what it was. Something like qtweb
@Sebas0173YT
@Sebas0173YT 2 жыл бұрын
@@dicember92 I found how but how can i install an adblocker in this browser.
@cipherxen2
@cipherxen2 3 жыл бұрын
This is not "coding web browser", it's just "using web browser" in your application.
@whereisyourhijab
@whereisyourhijab 3 ай бұрын
Browsers basically use search engines to search and he is doing that. Making a browser doesn't mean you have to code the search engine yourself too
@cipherxen2
@cipherxen2 3 ай бұрын
​@@whereisyourhijabwhat search engine has to do with it? Do you even understand my comment.
@Logan_Wolf_Online
@Logan_Wolf_Online 2 ай бұрын
@@cipherxen2 You are using lines of code to set up an interface to interact with websites. Ergo you are coding a web browser. You can use C in Windows to create a Desktop app that does the same thing, and it is still coding an GUI program that lets you browse the web, a "web browser". What, do you want him to write it from Assembly instead?
@cipherxen2
@cipherxen2 2 ай бұрын
​@@Logan_Wolf_Onlineso by your logic, if I write a program import MyWebBrowser MyWebBrowser() Did I create a web browser? Or just used an existing one?
@sabungee4442
@sabungee4442 Жыл бұрын
9:08 what is exit code -1?
@Epsultamma
@Epsultamma 4 ай бұрын
The exit code is just a Boolean telling you if something went wrong. 1 means something did go wrong, and thus equates to true, and 0 means everything went as planned, and thus equates to false. If you are having issues with the project opening when you added the back and forward buttons implemented as it is in the video, try typing "lambda: " before the self.browser forward and back functions. It works for me.
@robinferizi9073
@robinferizi9073 3 жыл бұрын
So close to 100k, you can do it
@NeuralNine
@NeuralNine 3 жыл бұрын
Coming soon :D
@DJ-ResistanceNet
@DJ-ResistanceNet 3 ай бұрын
What software tool app did you download and use to create web browser in python?
@OmarHosam203
@OmarHosam203 3 жыл бұрын
yay finally i can do something that big tech companies do
@MACAPOBREJUNERAYM
@MACAPOBREJUNERAYM 2 ай бұрын
nice short and easy to understand and follow man
@If0n702
@If0n702 2 жыл бұрын
Can you post the source code somewhere?
@Afkmuds
@Afkmuds Жыл бұрын
can you tell me why i can write it exactly as you do an check the install on mhy pips and its just like mmm nah
@ActivoApperal
@ActivoApperal 3 жыл бұрын
what form of python are you using, my cmd line/prompt looks way different?
@MrinmoyHaloi
@MrinmoyHaloi 3 жыл бұрын
hey neuralnine. Don't use wildcard imports. Its not a good practice. It can affect the performance of the app.
@g0blax171
@g0blax171 3 жыл бұрын
After seeing your videos (which ones are really good), I was wondering if it is possible to create a KZbin clone or Twitch clone with Python and Flask... I was trying to search the way to connect the OBS for live streaming to an specific app created on Python but no clue found on internet... maybe you know or you can help me with that question. Thanks!!
@micsdf7
@micsdf7 3 жыл бұрын
There is a cool tutorial on how to create a Twitter clone in Django (Yep, not Flask). kzbin.info/www/bejne/nGK1kJWvoL17fac . I personally didn't finish it, but it was very useful.
@joiverx1227
@joiverx1227 3 жыл бұрын
well all the source code of twitch got leaked so if you got your hands on it you can def make a close to 100% clone
@mohammadaboonajmi2927
@mohammadaboonajmi2927 2 жыл бұрын
I click on run but nothing come up what should i do?
@Epsultamma
@Epsultamma 4 ай бұрын
If you are having issues with the project opening when you added the back and forward buttons implemented as it is in the video, try typing "lambda: " before the self.browser forward and back functions. It works for me.
@robinferizi9073
@robinferizi9073 3 жыл бұрын
Am I able to add extensions and plugins and stuff?
@MrinmoyHaloi
@MrinmoyHaloi 3 жыл бұрын
no you can't. although it uses code from chromium (chrome is based on chromium) but its modified to work better with qt. all of the google services are striped out. so i think you can't install extensions.
@robinferizi9073
@robinferizi9073 3 жыл бұрын
@@MrinmoyHaloi I didn’t mean chrome extensions, I meant can I add native extensions and plugins
@MrinmoyHaloi
@MrinmoyHaloi 3 жыл бұрын
@@robinferizi9073 what do you mean by native plugins
@robinferizi9073
@robinferizi9073 3 жыл бұрын
@@MrinmoyHaloi I mean making my own plugins for my browser and making my own extension store instead of chrome extensions
@IEBqp
@IEBqp 3 жыл бұрын
I would say if you are good enough you can but then i remembered you asked this question, if you were good enough you wouldnt ask it soo i am saying no
@erenktw
@erenktw 2 жыл бұрын
how the add videoplayer for twitch ?
@ZoeyTheChicken
@ZoeyTheChicken 2 жыл бұрын
how much storage will python take up? with PyQt5 And whatever the other one is
@sayori3939
@sayori3939 2 жыл бұрын
Since it's only code(a LOT OF CODE) it probably shouldn't take more than 100mb but i doubt it will reach 100 mb
@manifestasisanubari
@manifestasisanubari 10 ай бұрын
Hello. How do you download files from PyQt Browser?
@wheelawake
@wheelawake 3 жыл бұрын
Great video! Wonder if this can be used for a custom selenium/browser automation type application. Excited to tinker with it, thanks!
@Victor_Marius
@Victor_Marius 3 жыл бұрын
I tried using selenium but it's painful
@qock1106
@qock1106 3 жыл бұрын
@@Victor_Marius nah its ez ur just inexperienced
@Victor_Marius
@Victor_Marius 3 жыл бұрын
@@qock1106 Selenium is painful because you have to keep the driver updated to the same version as the browser which can update automatically (Chrome). And some drivers won't work so easy
@gnsf
@gnsf 2 жыл бұрын
@@Victor_Marius naaah, it's easy if you know html and stuff as well
@VideoWithEnglishsubtitles
@VideoWithEnglishsubtitles 2 жыл бұрын
how does it work with all video formats?
@Lazar-vk9vw
@Lazar-vk9vw Жыл бұрын
Hey, a quick question, is it possible to implement the console somehow? I want to make an app that can run JS code for you in the web browser, so, wondering if that is possible
@roshanyadav4459
@roshanyadav4459 3 жыл бұрын
sir qtwebEngineWidgets not importing error
@SaarthiProGamerYT
@SaarthiProGamerYT 4 ай бұрын
In mine it is showing pip is not recognized. Please help.
@DGA2000
@DGA2000 Жыл бұрын
I thank you for a very interesting and informative vid but for some reason it won't let me navigate to, or use an url, to get to a pdf url. Why could this be happening?
@kaanakdik9455
@kaanakdik9455 2 жыл бұрын
The download process doesn't work when i press a downloadable link in any website. Should i add a feature to qwebengine or what must i do?
@kaanakdik9455
@kaanakdik9455 2 жыл бұрын
I solved the problem myself again. QT does not allow to download process normally. For do it, we must use QWebEngineDownloadItem class with downloadRequest signal. It was easily to use.
@nexboygaming
@nexboygaming 3 ай бұрын
Does this work in IDLE?
@RomaCatholica
@RomaCatholica Жыл бұрын
Somehow my python still doesn't recognize PyQt5, i've uninstalled and installed it so many times and it still doesn't recognize. What should i do?
@TheXtremerEditor
@TheXtremerEditor 5 ай бұрын
i tried making a python env like venv
@RomaCatholica
@RomaCatholica 5 ай бұрын
@@TheXtremerEditor I fixed it already, it was a year ago hahaha I'm currently using spyder
@ankdo8044
@ankdo8044 3 жыл бұрын
Oh , you using pyqt now!😲
@MJ-tn8tw
@MJ-tn8tw 3 жыл бұрын
Thankyou is it possible to implement WebEngine view within a page
@Asr_Mapping
@Asr_Mapping Жыл бұрын
hey dude I did the code good but it don't work and also it has 17 errors and 2 weak warnings for some reason
@johntheocharis573
@johntheocharis573 3 жыл бұрын
When I press the run buton it doesn't run. Why?
@kaanakdik9455
@kaanakdik9455 2 жыл бұрын
It works fine when I run the codes from within pyCharm. But after converting it to exe via pyinstaller, the exe application works but does not show the web page in the window. It waits as a blank screen. Do you have an idea for this issue?
@kaanakdik9455
@kaanakdik9455 2 жыл бұрын
I solved the problem. It is necessary to use PySide2 instead of PyQt5. There is a licensing difference between them. The codes are exactly the same. Just use PySide2 instead of PyQt5 during import. But still i wonder that why PyQt5 don't show the web page. What does that have to do with PyQt5 licensing?
@Pwnedby
@Pwnedby 2 жыл бұрын
@@kaanakdik9455 thanks man
@kaanakdik9455
@kaanakdik9455 2 жыл бұрын
@@Pwnedby 👍
@clarkcodm9263
@clarkcodm9263 3 жыл бұрын
can we make tabs with it?
@IzUrBoiKK
@IzUrBoiKK 3 жыл бұрын
Brooooo Congo! This vid is getting views so fast!!!!!!!!
@BkkaPunyosuk
@BkkaPunyosuk 3 жыл бұрын
Rt
@BkkaPunyosuk
@BkkaPunyosuk 3 жыл бұрын
d0
@souravjha2146
@souravjha2146 3 жыл бұрын
4k to go man
@NeuralNine
@NeuralNine 3 жыл бұрын
Soon :)
@hungry_rambler
@hungry_rambler Жыл бұрын
is there a way to put it on a usb? and transfer it to a different laptop
@LamiyaTaghiyeva
@LamiyaTaghiyeva 7 ай бұрын
If that pc has py imstalled then yes
@justcoding8373
@justcoding8373 2 жыл бұрын
How to add extensions ?
@parthbansal2775
@parthbansal2775 3 жыл бұрын
I wanted to know the python book that you recommend in the description, do they only involve data structures and algorithms or they involve libraries that you use to make this Fire content? Once again, really like your tutorial/projects on Machine learning
@ralphanthony5198
@ralphanthony5198 Жыл бұрын
Great video-tutorials, amigo. You're good! And I have a question hoping you can answer: I have been trying to create an app where I can open three websites in three different QTabs. Using PyQt5 or PyQt6. But my sites have chats, and the chat doesn't load along with the website unless I use pywebview. So my question is: how can I add tabs to a window using pywebview and display a site in them, so I can select from a dropdown the site that I want to open (within the same window, not multiple windows)? Any help will be greatly appreciated! Keep up the great work, it helps more than you can imagine!
@springchilli4481
@springchilli4481 Жыл бұрын
Man my idle is spitting out 4 million syntax errors
@btplayzx2438
@btplayzx2438 2 жыл бұрын
can you make a tutorial on how to code a adblocker for this browser
@Redlava
@Redlava 3 ай бұрын
please make this public on github I cant figure out whats wrong with my code
@jasondelong83
@jasondelong83 2 жыл бұрын
Extremely useful, thank you. Do you have any resources on how to work with cookies on this?
@efeloteishe4675
@efeloteishe4675 2 жыл бұрын
its based on chromium so everything is already set up
@MultiDenver1988
@MultiDenver1988 Жыл бұрын
anyone know if have way download file ? and upload ? with PQT 5 ?
@ambientsoda106
@ambientsoda106 2 жыл бұрын
Hey, can these browser access the dark web?
@ixink
@ixink 3 жыл бұрын
Can anybody help me to add download & history button on this project cause my college mini project similar
@emperorj4783
@emperorj4783 3 жыл бұрын
?? years from now* Man creates internet 2.0 Who's that? NeuralNine! :D
@joelminecrafter2640
@joelminecrafter2640 Жыл бұрын
why dosnt this code work from PyQt5.QtCore import QUrl from PyQt5.QtGui import QIcon, QKeySequence from PyQt5.QtWidgets import QApplication, QMainWindow, QTabWidget, QWidget, QVBoxLayout, QHBoxLayout, QLineEdit, QPushButton, QAction from PyQt5.QtWebEngineWidgets import QWebEngineView, QWebEnginePage class InsecurePage(QWebEnginePage): def certificateError(self, error): return False class BrowserTab(QWidget): def __init__(self): super().__init__() self.layout = QVBoxLayout() self.search_box = QLineEdit() self.search_button = QPushButton("Search") self.layout.addWidget(self.search_box) self.layout.addWidget(self.search_button) self.webview = QWebEngineView() self.layout.addWidget(self.webview) self.setLayout(self.layout) self.search_button.clicked.connect(self.loadUrl) self.search_box.returnPressed.connect(self.loadUrl) def loadUrl(self): url = self.search_box.text() if not url.startswith("http"): url = "" + url self.webview.load(QUrl(url)) class BrowserWindow(QMainWindow): def __init__(self, parent=None): super().__init__(parent) self.tabs = QTabWidget() self.setCentralWidget(self.tabs) self.tabs.setTabsClosable(True) self.tabs.tabCloseRequested.connect(self.closeTab) # Create the menu bar menu_bar = self.menuBar() file_menu = menu_bar.addMenu("&File") # Create a new tab action new_tab_action = QAction(QIcon.fromTheme("tab-new"), "New &Tab", self) new_tab_action.setShortcut(QKeySequence.New) new_tab_action.triggered.connect(self.addNewTab) file_menu.addAction(new_tab_action) # Set the initial window properties self.setWindowTitle("Python Browser") self.setGeometry(100, 100, 800, 600) # Add the initial tab self.addNewTab() def addNewTab(self): tab = BrowserTab() self.tabs.addTab(tab, "New Tab") self.tabs.setCurrentWidget(tab) def closeTab(self, index): if self.tabs.count() > 1: self.tabs.removeTab(index) if __name__ == "__main__": import sys app = QApplication(sys.argv) window = BrowserWindow() window.show() sys.exit(app.exec_())
@ChaosArtist
@ChaosArtist 9 ай бұрын
Great tutorial. Thanks.
@Dragonal_youtube
@Dragonal_youtube 5 ай бұрын
hi i watching on your video with my web browser :D
@kanishkmishra1017
@kanishkmishra1017 3 жыл бұрын
You have been always great 👍
@Ноунеймбезгалочки-м7ч
@Ноунеймбезгалочки-м7ч 10 ай бұрын
no tabs I can't login😭😭
@WeirdDev69
@WeirdDev69 3 жыл бұрын
using google na ?
@AbdullahAlMamun-ej4my
@AbdullahAlMamun-ej4my 3 жыл бұрын
Well I though you are gonna make it from scratch 🤣
@guilherme5094
@guilherme5094 3 жыл бұрын
Really nice!
@vihaankakkarvlogs6892
@vihaankakkarvlogs6892 2 жыл бұрын
Very bad Its showing incorrect in the 7th line
@razor8629
@razor8629 2 жыл бұрын
I am trying to create a web browser using your video. It worked good, I can connect to my Disney+ account but the issue comes when I try to play a video. It's seems that Dineyplus blocked access if it doesn't recognise the browser ? Or a library PIP is missing ? Could you help please ?
@navinross3357
@navinross3357 Жыл бұрын
It's possible that Disney+ has implemented some form of browser detection to block access to their videos if the browser is not recognized. This is a common technique used by streaming services to prevent piracy and unauthorized access. To work around this issue, you can try spoofing your browser's user agent to make it appear as a different browser that Disney+ recognizes. You can do this by adding an HTTP header to your requests with the user agent string of a known browser.
@friendlybear5924
@friendlybear5924 3 жыл бұрын
Why though
@zanylyf
@zanylyf 3 ай бұрын
great video
@subhankarchakraborty3866
@subhankarchakraborty3866 3 жыл бұрын
This is what I searching for, thak you @nuralnine 😜
@fatinishmam5213
@fatinishmam5213 Жыл бұрын
Please provide link of codes of your video in description. It is very helpful to get the codes in one place for coping.
@RaheelJunaid
@RaheelJunaid 3 жыл бұрын
You copying my webcam positioning xD. Just kidding of course; thanks for the helpful tutorial!
@fater8711
@fater8711 3 жыл бұрын
Ahahah
@MorroTX24YT
@MorroTX24YT 2 жыл бұрын
Thank you
@VideoWithEnglishsubtitles
@VideoWithEnglishsubtitles 2 жыл бұрын
thank you for guide
@emperorj4783
@emperorj4783 3 жыл бұрын
"Simple web browser" 1) That's not "simple" 2) That looks like a real browser 3) Meanwhile me struggling to install windows
@Brlitzkreig
@Brlitzkreig Жыл бұрын
Flori mo bur je shqiptare. Bro are you Albanian your name means gold
@h2dw1
@h2dw1 2 жыл бұрын
thanks bro
@zuberkariye2299
@zuberkariye2299 3 жыл бұрын
You're gonna hit 100k this for sure!!! Trust me! BTW, I came here to get it motivated!
@mrmelon8
@mrmelon8 Жыл бұрын
Do it in C 💀
@gnsf
@gnsf 2 жыл бұрын
import browser
@philtoa334
@philtoa334 2 жыл бұрын
Thx
@arnavnaik2135
@arnavnaik2135 3 жыл бұрын
cool
@aarushkumar168
@aarushkumar168 3 жыл бұрын
First!!
@codenerd7823
@codenerd7823 3 жыл бұрын
22second only
@osiris5449
@osiris5449 2 жыл бұрын
Watching tutorials, I keep seeing videos which seems like the people who may be attacking me online. Go figure, I'm subscribed to them. But, I wasn't to you? I just subscribed, I'm so confused. These other YT out here be hacking their viewers? 😂
@butterbean_v
@butterbean_v 11 ай бұрын
pls give me the code im to bord to do it
@Silly_Werewolf
@Silly_Werewolf 2 жыл бұрын
can somebody tell me why my browser don't work? i cannot see the web pages the code is this from PyQt5.QtWidgets import * from PyQt5.QtCore import * from PyQt5.QtWebEngineWidgets import * class MyBrowser(QMainWindow): def __init__(self): self.window = QWidget() self.window.setWindowTitle('MyBrowser') self.layout = QVBoxLayout() self.horizontal = QHBoxLayout() self.url_bar = QTextEdit() self.url_bar.setMaximumHeight(30) self.go_btn = QPushButton("->") self.go_btn.setMinimumHeight(30) self.back_btn = QPushButton("«") self.back_btn.setMinimumHeight(30) self.forward_btn = QPushButton("»") self.forward_btn.setMinimumHeight(30) self.horizontal.addWidget(self.url_bar) self.horizontal.addWidget(self.go_btn) self.horizontal.addWidget(self.back_btn) self.horizontal.addWidget(self.forward_btn) self.browser = QWebEngineView() self.go_btn.clicked.connect(lambda: self.navigate(self.url_bar.toPlainText())) self.forward_btn.clicked.connect(self.browser.forward) self.back_btn.clicked.connect(self.browser.back) self.layout.addLayout(self.horizontal) self.layout.addWidget(self.browser) self.browser.setUrl(QUrl("google.com")) self.window.setLayout(self.layout) self.window.show() def navigate(self, url): if not url.startswith("http"): url = "" + url self.url_bar.setText(url) self.browser.setUrl(QUrl(url)) app = QApplication([]) window = MyBrowser() app.exec_()
@markusotte3442
@markusotte3442 Жыл бұрын
Thank you, the Code works fine!
@Silly_Werewolf
@Silly_Werewolf Жыл бұрын
@@markusotte3442 ?
Minimal Flask REST API in Python
25:37
NeuralNine
Рет қаралды 43 М.
Python Sockets Simply Explained
39:33
NeuralNine
Рет қаралды 168 М.
Chain Game Strong ⛓️
00:21
Anwar Jibawi
Рет қаралды 41 МЛН
When you have a very capricious child 😂😘👍
00:16
Like Asiya
Рет қаралды 18 МЛН
Try this prank with your friends 😂 @karina-kola
00:18
Andrey Grechka
Рет қаралды 9 МЛН
Quando A Diferença De Altura É Muito Grande 😲😂
00:12
Mari Maria
Рет қаралды 45 МЛН
Mail Client with GUI in Python
37:21
NeuralNine
Рет қаралды 19 М.
Create Stunning Python GUIs in 10 Minutes With Drag & Drop
11:38
Coding Is Fun
Рет қаралды 103 М.
Build a Python Website in 15 Minutes With Streamlit
18:37
Tech With Tim
Рет қаралды 86 М.
How I make bots using python (educational)
17:12
Kian Brose
Рет қаралды 568 М.
How does a browser work ? | Engineering side
30:22
Hitesh Choudhary
Рет қаралды 111 М.
Secure Login System in Python
14:43
NeuralNine
Рет қаралды 114 М.
Python laid waste to my C++!
17:18
Sheafification of G
Рет қаралды 153 М.
host ALL your AI locally
24:20
NetworkChuck
Рет қаралды 1,5 МЛН
Convert GUI App to Real Program -  Python to exe to setup wizard
23:27
Python Simplified
Рет қаралды 556 М.
Modern Graphical User Interfaces in Python
11:12
NeuralNine
Рет қаралды 1,6 МЛН
Chain Game Strong ⛓️
00:21
Anwar Jibawi
Рет қаралды 41 МЛН