Oh Snap!

Please turnoff your ad blocking mode for viewing your site content

Hit enter after type your search item

Python 3 Web Scraping Script to Scrape the Domain Age of Website or URL Full Command Line Project For Beginners

/
/
/
45 Views

 

Welcome folks today in this post we will be scraping the domain age of website using json module. All the full source code of the application will be shown below

 

 

 

Get Started

 

 

In order to get started you need to install the following libraries inside your python project using the pip command

 

pip install requests

 

pip install json

 

After installing this make an app.py file and copy paste the following code

 

app.py

 

 

import os
import requests
import json

print("""\
 
             \_`-)|_
          ,""       \ 
        ," ##   |   o o. 
      ,"  ##   ,-\__    `.
    ,"   ##   /     `--._;)
  ,"    ##   /
 ,"    ##   /

                    """)


CRED = '\033[91m'
CEND = '\033[0m'
YELLOW = '\033[92m'
RED = '\033[91m'
   
enterurl = input(YELLOW + "Enter Your Domain Name (example.com)? " + CEND)
url = enterurl.split("//")[-1].split("/")[0].split('?')[0]
show = "https://input.payapi.io/v1/api/fraud/domain/age/" + url
r = requests.get(show)

os.system('clear')  # on linux / os x

if r.status_code == 200:
    print 
    print(RED + "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" + CEND)
    print(RED + "************************************************************" + CEND)
    print 

    
    data = r.text
    jsonToPython = json.loads(data)

    print(YELLOW + "Domain Name: " + CEND + url)
    print 
    print(jsonToPython['message'])

    print 
    print(RED + "************************************************************" + CEND)
    print(RED + "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" + CEND)
    print 
else:
    print(RED + "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" + CEND)
    print(RED + "************************************************************" + CEND)
    print 

    print(YELLOW + " - There Is A Problem" + CEND)
    print(YELLOW + " - Checking The Connection " + CEND)
    print(YELLOW + " - Enter Website Without HTTP/HTTPS/WWW " + CEND)
    print(YELLOW + " - Check If Website Working " + CEND)

    print 
    print(RED + "************************************************************" + CEND)
    print(RED + "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" + CEND)
    print

 

READ  Python 3 Tkinter GUI Script to Encode or Encrypt and Decrypt or Decode Strings Desktop App Full Project For Beginners

 

And now if you execute the script by typing the below command

 

python app.py

 

It will ask you to enter your domain name and then if you submit it will calculate or scrape the domain age for you as shown below in the figure

 

 

Leave a Comment

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

This div height required for enabling the sticky sidebar
Coding Shiksha 2020. All Rights Reserved.
Ad Clicks : Ad Views : Ad Clicks : Ad Views : Ad Clicks : Ad Views : Ad Clicks : Ad Views : Ad Clicks : Ad Views : Ad Clicks : Ad Views : Ad Clicks : Ad Views : Ad Clicks : Ad Views : Ad Clicks : Ad Views : Ad Clicks : Ad Views : Ad Clicks : Ad Views : Ad Clicks : Ad Views :