RYU-KASH commited on
Commit
76a3387
·
verified ·
1 Parent(s): 790b386

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -7
app.py CHANGED
@@ -722,12 +722,22 @@ gbc = GradientBoostingClassifier(max_depth=4,learning_rate=0.7)
722
  gbc.fit(X_train,y_train)
723
 
724
  import streamlit as st
 
 
 
725
  url = st.text_input("Enter the Url:", key="url_input")
726
  #can provide any URL. this URL was taken from PhishTank
727
- obj = FeatureExtraction(url)
728
- x = np.array(obj.getFeaturesList()).reshape(1,30)
729
- y_pred =gbc.predict(x)[0]
730
- if y_pred==1:
731
- print("We guess it is a safe website")
732
- else:
733
- print("Caution! Suspicious website detected")
 
 
 
 
 
 
 
 
722
  gbc.fit(X_train,y_train)
723
 
724
  import streamlit as st
725
+ st.title("Phishing Website Detection")
726
+
727
+ # User input for URL
728
  url = st.text_input("Enter the Url:", key="url_input")
729
  #can provide any URL. this URL was taken from PhishTank
730
+
731
+ # Predict and display the result
732
+ if st.button("Check"):
733
+ if url:
734
+ obj = FeatureExtraction(url)
735
+ x = np.array(obj.getFeaturesList()).reshape(1, 30)
736
+ y_pred = gbc.predict(x)[0]
737
+ if y_pred == 1:
738
+ st.write("We guess it is a safe website")
739
+ else:
740
+ st.write("Caution! Suspicious website detected")
741
+ st.write(y_pred)
742
+ else:
743
+ st.write("Please enter a URL.")