<jupyter_start><jupyter_text>Daraz Scraper  Reviews for a single product<jupyter_code>import requests
import re
import json

 # customize the header dictionary for your need

headers = {
        'authority': 'www.daraz.com.bd',
        'pragma': 'no-cache',
        'cache-control': 'no-cache',
        'dnt': '1',
        'upgrade-insecure-requests': '1',
        'user-agent': 'Mozilla/5.0 (X11; CrOS x86_64 8172.45.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.64 Safari/537.36',
        'accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9',
        'sec-fetch-site': 'none',
        'sec-fetch-mode': 'navigate',
        'sec-fetch-dest': 'document',
        'accept-language': 'en-GB,en-US;q=0.9,en;q=0.8',
    }

# change the item_id, page_no and page_size as per the product
# this example will parse reviews of this product https://www.daraz.com.bd/products/mens-stylish-slide-slipper-sandal-i141964811-s1103036896.html

item_id = '141964811'
page_no = 1
page_size = 5

review_url = f'https://my.daraz.com.bd/pdp/review/getReviewList?itemId={item_id}&pageSize={page_size}&filter=0&sort=0&pageNo={page_no}'
review_request = requests.get(review_url, headers=headers)


review_dict_list = json.loads(review_request.text)
review_dict_list<jupyter_output><empty_output><jupyter_text>Reviews<jupyter_code># check the review dictionary
for review in review_dict_list['model']['items']:
  print(json.dumps(review, indent = 4))


# check only the reviews
for counter,review in  enumerate(review_dict_list['model']['items'],start=1) :
  print(counter,dict(review)['reviewContent'],sep='\t')<jupyter_output>1	Such a good product. I am happy to got this product. Thanks daraz and sailor. If you interested, can buy.
2	original product R 😍😍
Tnq so much eto vlo product dewar jnno
apnara  chaile nite paren..
3	যেমনটা দেখেছিলাম,যেমন আসা করেছিলাম তেমনটাই পেয়েছি।thank you daraz,thank you daraz mall.
4	Thik jemon ta chyci omon tai paice.
tnxxxx a lot.
product ta onk vlo deyar jonne.
❤❤❤❤
5	product valo sondor size o tikh ase ❤️ Shudu beshi lighting kore😂 kintu 27/02/2021 a order korlam 800 taka diye pray kintu delivery pawar por dekhi dam 649 hoye gese😢 ai kemon bichar
{'fraction_non_alphanumeric': 0.13417281806339557, 'fraction_numerical': 0.04342162396873643, 'mean_word_length': 4.1086474501108645, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '123379', 'license': 'Apache-2.0', 'n_tokens_mistral': 959, 'n_tokens_neox': 919, 'n_words': 206, 'path': 'daraz_scraper.ipynb', 'repo_name': 'ahmedshahriar/daraz-scraper', 'size': '2303'}