Coding A Simple Web Browser in Python

แชร์
ฝัง
  • เผยแพร่เมื่อ 16 ก.ย. 2024

ความคิดเห็น • 134

  • @addledanorak8297
    @addledanorak8297 3 ปีที่แล้ว +50

    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 ปีที่แล้ว +2

      But how do you get your flask app on the window

    • @addledanorak8297
      @addledanorak8297 3 ปีที่แล้ว +7

      7:16
      Use the setUrl function and pass in the localhost url your flask app is running on

    • @robinferizi9073
      @robinferizi9073 3 ปีที่แล้ว +1

      @@addledanorak8297 but how would you show other webpages? And how would you keep the url bar and whatnot there

    • @MrinmoyHaloi
      @MrinmoyHaloi 3 ปีที่แล้ว +2

      @@robinferizi9073 you can do that with html and js

    • @addledanorak8297
      @addledanorak8297 3 ปีที่แล้ว +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

  • @dany_fg
    @dany_fg หลายเดือนก่อน +3

    this is great for django/flask/fastapi based apps, as you can create a web window for the server without the user even realizing

  • @dicember92
    @dicember92 2 ปีที่แล้ว +5

    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 ปีที่แล้ว +1

      @@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 2 ปีที่แล้ว +7

    This is not "coding web browser", it's just "using web browser" in your application.

  • @robinferizi9073
    @robinferizi9073 3 ปีที่แล้ว +5

    So close to 100k, you can do it

    • @NeuralNine
      @NeuralNine  3 ปีที่แล้ว +2

      Coming soon :D

  • @OmarHosam203
    @OmarHosam203 3 ปีที่แล้ว +5

    yay finally i can do something that big tech companies do

  • @MrinmoyHaloi
    @MrinmoyHaloi 3 ปีที่แล้ว +3

    hey neuralnine. Don't use wildcard imports. Its not a good practice. It can affect the performance of the app.

  • @parthbansal2775
    @parthbansal2775 3 ปีที่แล้ว +12

    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

  • @kanishkmishra1017
    @kanishkmishra1017 3 ปีที่แล้ว +2

    You have been always great 👍

  • @souravjha2146
    @souravjha2146 3 ปีที่แล้ว +2

    4k to go man

  • @ankdo8044
    @ankdo8044 3 ปีที่แล้ว +3

    Oh , you using pyqt now!😲

  • @wheelawake
    @wheelawake 3 ปีที่แล้ว +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 2 ปีที่แล้ว

      @@Victor_Marius nah its ez ur just inexperienced

    • @Victor_Marius
      @Victor_Marius 2 ปีที่แล้ว

      @@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

  • @Dragonal_youtube
    @Dragonal_youtube 2 หลายเดือนก่อน

    hi i watching on your video with my web browser :D

  • @If0n702
    @If0n702 2 ปีที่แล้ว +3

    Can you post the source code somewhere?

  • @DJ-ResistanceNet
    @DJ-ResistanceNet 9 วันที่ผ่านมา

    What software tool app did you download and use to create web browser in python?

  • @ChaosArtist
    @ChaosArtist 6 หลายเดือนก่อน

    Great tutorial. Thanks.

  • @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!

  • @emperorj4783
    @emperorj4783 3 ปีที่แล้ว

    ?? years from now*
    Man creates internet 2.0
    Who's that? NeuralNine! :D

  • @g0blax171
    @g0blax171 3 ปีที่แล้ว +2

    After seeing your videos (which ones are really good), I was wondering if it is possible to create a TH-cam 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 2 ปีที่แล้ว +1

      There is a cool tutorial on how to create a Twitter clone in Django (Yep, not Flask). th-cam.com/video/f1R_bykXHGE/w-d-xo.html . I personally didn't finish it, but it was very useful.

    • @joiverx1227
      @joiverx1227 2 ปีที่แล้ว

      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

  • @ActivoApperal
    @ActivoApperal 3 ปีที่แล้ว +1

    what form of python are you using, my cmd line/prompt looks way different?

  • @springchilli4481
    @springchilli4481 ปีที่แล้ว

    Man my idle is spitting out 4 million syntax errors

  • @subhankarchakraborty3866
    @subhankarchakraborty3866 3 ปีที่แล้ว +2

    This is what I searching for, thak you @nuralnine 😜

  • @IzUrBoiKK
    @IzUrBoiKK 3 ปีที่แล้ว

    Brooooo Congo! This vid is getting views so fast!!!!!!!!

  • @SaarthiProGamerYT
    @SaarthiProGamerYT หลายเดือนก่อน

    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?

  • @sabungee4442
    @sabungee4442 ปีที่แล้ว +2

    9:08 what is exit code -1?

    • @Epsultamma
      @Epsultamma 27 วันที่ผ่านมา

      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.

  • @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

  • @guilherme5094
    @guilherme5094 3 ปีที่แล้ว

    Really nice!

  • @zanylyf
    @zanylyf 12 วันที่ผ่านมา

    great video

  • @Lazar-vk9vw
    @Lazar-vk9vw 11 หลายเดือนก่อน

    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

  • @ZoeyTheChicken
    @ZoeyTheChicken 2 ปีที่แล้ว +1

    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

  • @Afkmuds
    @Afkmuds 9 หลายเดือนก่อน

    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

  • @btplayzx2438
    @btplayzx2438 2 ปีที่แล้ว

    can you make a tutorial on how to code a adblocker for this browser

  • @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

  • @roshanyadav4459
    @roshanyadav4459 3 ปีที่แล้ว +1

    sir qtwebEngineWidgets not importing error

  • @mohammadaboonajmi2927
    @mohammadaboonajmi2927 ปีที่แล้ว +1

    I click on run but nothing come up what should i do?

    • @Epsultamma
      @Epsultamma 27 วันที่ผ่านมา

      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.

  • @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_())

  • @MJ-tn8tw
    @MJ-tn8tw 3 ปีที่แล้ว

    Thankyou is it possible to implement WebEngine view within a page

  • @zuberkariye2299
    @zuberkariye2299 3 ปีที่แล้ว

    You're gonna hit 100k this for sure!!! Trust me! BTW, I came here to get it motivated!

  • @nexboygaming
    @nexboygaming 5 วันที่ผ่านมา

    Does this work in IDLE?

  • @manifestasisanubari
    @manifestasisanubari 7 หลายเดือนก่อน

    Hello. How do you download files from PyQt Browser?

  • @mati_rblx24
    @mati_rblx24 2 ปีที่แล้ว

    Thank you

  • @VideoWithEnglishsubtitles
    @VideoWithEnglishsubtitles 2 ปีที่แล้ว

    thank you for guide

  • @AbdullahAlMamun-ej4my
    @AbdullahAlMamun-ej4my 3 ปีที่แล้ว +1

    Well I though you are gonna make it from scratch 🤣

  • @johntheocharis573
    @johntheocharis573 2 ปีที่แล้ว

    When I press the run buton it doesn't run. Why?

  • @RaheelJunaid
    @RaheelJunaid 3 ปีที่แล้ว +1

    You copying my webcam positioning xD. Just kidding of course; thanks for the helpful tutorial!

  • @kaanakdik9455
    @kaanakdik9455 ปีที่แล้ว

    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 ปีที่แล้ว

      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.

  • @VideoWithEnglishsubtitles
    @VideoWithEnglishsubtitles 2 ปีที่แล้ว

    how does it work with all video formats?

  • @programmingwithh2d566
    @programmingwithh2d566 2 ปีที่แล้ว

    thanks bro

  • @clarkcodm9263
    @clarkcodm9263 2 ปีที่แล้ว

    can we make tabs with it?

  • @erenktw
    @erenktw ปีที่แล้ว

    how the add videoplayer for twitch ?

  • @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?

    • @TheXtremeCartooner
      @TheXtremeCartooner 2 หลายเดือนก่อน

      i tried making a python env like venv

    • @RomaCatholica
      @RomaCatholica 2 หลายเดือนก่อน

      @@TheXtremeCartooner I fixed it already, it was a year ago hahaha I'm currently using spyder

  • @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 ปีที่แล้ว +1

      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 ปีที่แล้ว +1

      @@kaanakdik9455 thanks man

    • @kaanakdik9455
      @kaanakdik9455 ปีที่แล้ว

      @@Pwnedby 👍

  • @user-ro2tm3dp8x
    @user-ro2tm3dp8x 7 หลายเดือนก่อน

    no tabs I can't login😭😭

  • @ixink
    @ixink 3 ปีที่แล้ว

    Can anybody help me to add download & history button on this project cause my college mini project similar

  • @philtoa334
    @philtoa334 2 ปีที่แล้ว

    Thx

  • @robinferizi9073
    @robinferizi9073 3 ปีที่แล้ว +1

    Am I able to add extensions and plugins and stuff?

    • @MrinmoyHaloi
      @MrinmoyHaloi 3 ปีที่แล้ว +1

      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 ปีที่แล้ว +1

      @@MrinmoyHaloi I didn’t mean chrome extensions, I meant can I add native extensions and plugins

    • @MrinmoyHaloi
      @MrinmoyHaloi 3 ปีที่แล้ว +1

      @@robinferizi9073 what do you mean by native plugins

    • @robinferizi9073
      @robinferizi9073 3 ปีที่แล้ว +1

      @@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

  • @justcoding8373
    @justcoding8373 2 ปีที่แล้ว

    How to add extensions ?

  • @MultiDenver1988
    @MultiDenver1988 ปีที่แล้ว

    anyone know if have way download file ? and upload ? with PQT 5 ?

  • @ambientsoda106
    @ambientsoda106 ปีที่แล้ว

    Hey, can these browser access the dark web?

  • @hungry_rambler
    @hungry_rambler ปีที่แล้ว

    is there a way to put it on a usb? and transfer it to a different laptop

    • @LamiyaTaghiyeva
      @LamiyaTaghiyeva 4 หลายเดือนก่อน

      If that pc has py imstalled then yes

  • @vihaankakkarvlogs6892
    @vihaankakkarvlogs6892 2 ปีที่แล้ว

    Very bad
    Its showing incorrect in the 7th line

  • @arnavnaik2135
    @arnavnaik2135 3 ปีที่แล้ว

    cool

  • @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.

  • @Brlitzkreig
    @Brlitzkreig ปีที่แล้ว

    Flori mo bur je shqiptare. Bro are you Albanian your name means gold

  • @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

  • @mrmelon8
    @mrmelon8 8 หลายเดือนก่อน

    Do it in C 💀

  • @WeirdDev69
    @WeirdDev69 3 ปีที่แล้ว

    using google na ?

  • @emperorj4783
    @emperorj4783 3 ปีที่แล้ว +2

    "Simple web browser"
    1) That's not "simple"
    2) That looks like a real browser
    3) Meanwhile me struggling to install windows

  • @gnsf
    @gnsf 2 ปีที่แล้ว

    import browser

  • @codenerd7823
    @codenerd7823 3 ปีที่แล้ว +1

    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? 😂

  • @aarushkumar168
    @aarushkumar168 3 ปีที่แล้ว +1

    First!!

  • @Silly_Werewolf
    @Silly_Werewolf ปีที่แล้ว +1

    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_()

  • @butterbean_v
    @butterbean_v 8 หลายเดือนก่อน

    pls give me the code im to bord to do it