09.10.2023 Views

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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 1

Introduction

def parseSoupTable(self, table):

#print "parsing table"

images = table.findAll("img")

over_all = str(images[0]).split("grn_bar_")[1].

split(".gif")[0]

money_value = str(images[1]).split("SCORE_")[1].

split(".gif")[0]

seat_comfort = str(images[2]).split("SCORE_")[1].

split(".gif")[0]

staff_service = str(images[3]).split("SCORE_")[1].

split(".gif")[0]

catering = str(images[4]).split("SCORE_")[1].

split(".gif")[0]

entertainment = str(images[4]).split("SCORE_")[1].

split(".gif")[0]

if 'YES' in str(images[6]):

recommend = 'YES'

else:

recommend = 'NO'

status = table.findAll("p", {"class":"text25"})

stat = str(status[2]).split(">")[1].split("<")[0]

return (stat, over_all, money_value, seat_comfort,

staff_service, catering, entertainment, recomend)

def collectThoughts(self):

#print "Collecting Thoughts"

for al in AirLineReviewCollector.airlines:

count = 0

while count < AirLineReviewCollector.limit:

count = count + 1

url = ''

7

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

Saved successfully!

Ooh no, something went wrong!