Our Services : Video Editing Classes, Ethical Hacking Workshop, Computer Classes, PC/Laptop Repair, Routers Sell, UPS Sell, Printers Sell, Scanners Sell, Website Development, APP Development, Computer Components
Call : 9846618997 | Newroad Pokhara

Python Programming For Hackers. PT 3 – Multiple Website Open Script – By Bijay Acharya

Python Programming for Hackers (Part 3) – Writing Scripts for Opening Multiple Websites at Once

(Note: For Video Demo/Lab, on this part, you can follow this link: https://youtu.be/iAXbbIGG6l0. In the video, I mention Part 5 FYI.)

By : Bijay Acharya (CEHv9. Trained Personnel)

Follow : twitter.com/acharya_bijay

Website : bijayacharya.com

Hello all and welcome to Part 3 of Python Programming For Hackers. Here, I’ll show you the script of Python, which can be used to open multiple websites at once. Run one script and open 100+ websites at once.

Before writing scripts, I want to explain something. I use ‘module’ in the script. And, what’s a module ?

Module: To make programming easier, Python has Modules. Modules contain useful code and help in extending Python’s functionality.

ct 3 bj

 

Let’s begin:

If you get confused, please refer the video demo link given above and at the bottom of this article.

 

Step 1 : Open Python Shell, and open new file (and type)

import webbrowser

In Python, the ‘import’ statement is used to add a module to your project. In this case, we want to add the ‘webbrowser’ module

 

Step 2 : Type

webbrowser.open(‘http://site name here’)

Here, we’re calling the open function on our default web browser. We pass it a URL in the form of a string. We can add as many websites as we want. For example:

webbrowser.open(‘http://site name 1 here’)

webbrowser.open(‘http://site name 2 here’)

The final code/script looks like this:

import webbrowser

webbrowser.open(‘http://google.com’)

webbrowser.open(‘http://facebook.com’)

webbrowser.open(‘http://itsolutionpokhara.com’)

Step 3: Save the file as, test.py (test = file name)

Let’s see it in Python Shell and let’s execute test.py

READ  Build your own PwnPhone - Mr.Robot Hack

(Note: For Video Demo/Lab, on this part, you can follow this link: https://youtu.be/iAXbbIGG6l0. In the video, I mention Part 5 FYI.)

By : Bijay Acharya (CEHv9. Trained Personnel)

Follow : twitter.com/acharya_bijay

Website : bijayacharya.com

student video tutorial, python programming for hackers, python for hackers, python tutorial, python programming nepali, python ethical hacker, python programming  hacking, bijay acharya

Related Post

Leave a Reply

Your email address will not be published. Required fields are marked *