Discussion on AI-VADER Algorithm for Product Review Analysis

As a take away from the completion of this course,

367d0dec-5f75-49ef-be9e-db24953385ea-image.png

at

airasiaacademy.com/on-demand-learning

Check your Knowledge by trying to extract the reviews and sentiments for the recommended websites

https://www.motherhood.com.my/baby-bathing/

https://giftr.my/collections/anniversary

https://www.groupon.com/browse/chicago?category=food-and-drink&subcategory=cafes-and-treats

If further help required or stuck in-between during scraping the data don’t worry!!!

Post your error or clarification over here, we can help you to solve it!!!!

Also

4c338cdc-191e-41ea-b114-4df2cc71d927-image.png

Hi Dr, I am trying to web scraping the website https://giftr.my/collections/anniversary based on the ODL.

But it seems that I have some trouble to extract the child link, I think the link is in a JSON format? I am not exactly sure.

4e813b65-5883-429d-bf75-8f6a6aa90756-image.png

I found that the product link is in this line of script but I do not know how to extract it.

443489d4-7f87-4a8c-a6ee-e3015bf9a84f-image.png

Hi Auni,
Sorry for the delayed response,
Appreciate your effort in trying web scraping in the sample website.
The problem with your extraction code is that you have not recognised the required children url tag.For example : you can try like this
response=requests.get("https://giftr.my/collections/anniversary ")
soup=bs4.BeautifulSoup(response.text,'html')
title=soup.title
print(title)
productlink=soup.find_all("div",{"class":"mega-sub-link"})
print(productlink)
#Extract the a tag
x=[]
for product1 in productlink:
prdt1=product1.find_all("a")
x.append(prdt1)
print(x)
#Extract the corresponding href
x2=[]
for i in range(len(x)-3):
x1=x[i][0].get('href')
x2.append(x1)
print(x2)
#if you have the parent link append it directly to the child link else add it with the baseurl and produce the child link
baseurl="https://giftr.my/"
childlink=[]
for i in range(0,len(x2)):
if 'https://giftr.my/' in x2[i]:
childlink.append(x2[i])
else:
childlink.append((baseurl+x2[i]))
#Print the child link
childlink

Hope this can resolve your issue in extracting the child link

@saranyaravikumar-0

Thank you for the explanation Dr, it seems that I misunderstood which child link that needs to be extracted. I will sure try to run your code.