Path: blob/master/Investigation/getComments2.py
193 views
import requests1from bs4 import BeautifulSoup2def printAll():3return comment4def _getComments2_(phone_number):5global comment6comment=[]7headers = {8"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:84.0) Gecko/20100101 Firefox/84.0",9}10phone_number=phone_number.split("+")[1]11reqToServer = requests.get(f"https://spamcalls.net/en/number/{phone_number}", headers=headers)12source = BeautifulSoup(reqToServer.content,"lxml")13comment_=source.select(f'p[lang="en"]')14for i in comment_:15comment.append(i.text)16if comment==[]:17comment.append("No comment for this number")18print(comment_)1920