shreyagopal / Phishing-Website-Detection-by-Machine-Learning-Techniques

228 stars 163 forks source link

Alexa API Deprecated #3

Open pooki3bear opened 3 years ago

pooki3bear commented 3 years ago

Hi @shreyagopal,

The alexa API in use seems to be unavailable. Live request of this data is slow, I replaced with the below

!wget http://s3.amazonaws.com/alexa-static/top-1m.csv.zip
!unzip -o top-1m.csv.zip
# 12.Web traffic (Web_Traffic)

import csv

with open('top-1m.csv') as f:
    reader = csv.reader(f)
    alexa = list(reader)

def web_traffic(url, alexa):
  domain = getDomain(url)
  try:
    rank = [i for i, v in enumerate(alexa) if v[1] == domain][0] + 1
  except:
    return 0
  if rank <100000:
    return 1
  else:
    return 0
Tryd3x commented 2 years ago

The notebook specifies that if the rank of a URL is less than 100000, it returns 1(Phishing)

if rank <100000:
    return 1
  else:
    return 0

which contradicts the purpose don't you think? I tested using legitimate websites like amazon.com, google.com and they ranked around 1-100 but the function returns it as phishing. Let me know if I am wrong about this. Should it be this instead?

if rank <100000:
    return 0 #legit
  else:
    return 1 #phishing
LeviathanGod commented 1 year ago

how to fix : when i run code results: Error trying to connect to socket: closing socket - timed out Error trying to connect to socket: closing socket - timed out Error trying to connect to socket: closing socket - [Errno -2] Name or service not known Error trying to connect to socket: closing socket - [Errno -2] Name or service not known Error trying to connect to socket: closing socket - [Errno -2] Name or service not known Error trying to connect to socket: closing socket - [Errno -2] Name or service not known Error trying to connect to socket: closing socket - [Errno -2] Name or service not known Error trying to connect to socket: closing socket - [Errno -2] Name or service not known Error trying to connect to socket: closing socket - [Errno -2] Name or service not known Error trying to connect to socket: closing socket - [Errno -2] Name or service not known Error trying to connect to socket: closing socket - [Errno -2] Name or service not known Error trying to connect to socket: closing socket - [Errno -2] Name or service not known Error trying to connect to socket: closing socket - [Errno -2] Name or service not known Error trying to connect to socket: closing socket - [Errno -2] Name or service not known Error trying to connect to socket: closing socket - [Errno -2] Name or service not known Error trying to connect to socket: closing socket - timed out

Dhanush0660 commented 4 months ago

how to fix : when i run code results: Error trying to connect to socket: closing socket - timed out Error trying to connect to socket: closing socket - timed out Error trying to connect to socket: closing socket - [Errno -2] Name or service not known Error trying to connect to socket: closing socket - [Errno -2] Name or service not known Error trying to connect to socket: closing socket - [Errno -2] Name or service not known Error trying to connect to socket: closing socket - [Errno -2] Name or service not known Error trying to connect to socket: closing socket - [Errno -2] Name or service not known Error trying to connect to socket: closing socket - [Errno -2] Name or service not known Error trying to connect to socket: closing socket - [Errno -2] Name or service not known Error trying to connect to socket: closing socket - [Errno -2] Name or service not known Error trying to connect to socket: closing socket - [Errno -2] Name or service not known Error trying to connect to socket: closing socket - [Errno -2] Name or service not known Error trying to connect to socket: closing socket - [Errno -2] Name or service not known Error trying to connect to socket: closing socket - [Errno -2] Name or service not known Error trying to connect to socket: closing socket - [Errno -2] Name or service not known Error trying to connect to socket: closing socket - timed out

are you able to find what the problem is