File size: 810 Bytes
0685ea8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import sys
sys.path.append('G:\Project\phishing-detection')
from phishingdetection import FeatureExtraction
import numpy as np
from phishingdetection import gbc
import streamlit as st

st.title("Phishing Website Detection")
#
# User input for URL
url = st.text_input("Enter the Url:", key="url_input")
#can provide any URL. this URL was taken from PhishTank

# Predict and display the result
if st.button("Check"):
    if url:
        obj = FeatureExtraction(url)
        x = np.array(obj.getFeaturesList()).reshape(1, 30)
        y_pred = gbc.predict(x)[0]
        if y_pred == 1:
            st.write("We guess it is a safe website")
        else:
            st.write("Caution! Suspicious website detected")
        st.write(y_pred)
    else:
        st.write("Please enter a URL.")