09.10.2023 Views

Advanced Data Analytics Using Python_ With Machine Learning, Deep Learning and NLP Examples ( 2023)

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 1

Introduction

super(AirLineReviewCo

llector,self).print_

args(args)

######################## Retail Chield ########################

class RetailReviewCollector(SkyThoughtCollector):

def __init__(self, configpath):

#print "In Config"

super(RetailReviewCollector,self).getConfig(configpath)

def collectThoughts(self):

soup = BeautifulSoup.BeautifulSoup(super(RetailRev

iewCollector,self).downloadURL(RetailReviewCollect

or.baseURl))

lines = soup.findAll("a",{"style":

"font- size:15px;"})

links = []

for line in lines:

if ("review" in str(line)) & ("target" in

str(line)):

ln = str(line)

link = ln.split("href=")[-1].split

("target=")[0].replace("\"","").

strip()

links.append(link)

for link in links:

soup = BeautifulSoup.BeautifulSoup(

super(RetailReviewCollector,self).

downloadURL(link))

9

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!