
from itertools import zip_longest

import requests
from bsa import BeautifulSoup
from pandas import DataFrame






def 		_UpperCAmelCase   (	UpperCamelCase:     str = "laptop"  ):






	"""simple docstring"""


	__lowerCAmelCase         =							F"https://www.amazon.in/laptop/s?k={product}"
	__lowerCAmelCase         =							{
	    "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36\n        (KHTML, like Gecko)Chrome/44.0.2403.157 Safari/537.36",
	    "Accept-Language": "en-US, en;q=0.5",
	}
	__lowerCAmelCase         =							BeautifulSoup(requests.get(UpperCamelCase			,							headers=UpperCamelCase  ).text  )
	# Initialize a Pandas dataframe with the column titles
	__lowerCAmelCase         =							DataFrame(
	    columns=[
	        "Product Title",
	        "Product Link",
	        "Current Price of the product",
	        "Product Rating",
	        "MRP of the product",
	        "Discount",
	    ]  )
	# Loop through each entry and store them in the dataframe
	for item, _ in zip_longest(
	    soup.find_all(
	        "div"			,							attrs={"class": "s-result-item", "data-component-type": "s-search-result"}			,							)			,							soup.find_all("div"			,							attrs={"class": "a-row a-size-base a-color-base"}  )			,							):
		try:
			__lowerCAmelCase         =							item.ha.text
			__lowerCAmelCase         =							"https://www.amazon.in/" + item.ha.a["href"]
			__lowerCAmelCase         =							item.find("span"			,							attrs={"class": "a-offscreen"}  ).text
			try:
				__lowerCAmelCase         =							item.find("span"			,							attrs={"class": "a-icon-alt"}  ).text
			except AttributeError:
				__lowerCAmelCase         =							"Not available"
			try:
				__lowerCAmelCase         =							(
				    "₹"
				    + item.find(
				        "span"			,							attrs={"class": "a-price a-text-price"}  ).text.split("₹"  )[1]
				)
			except AttributeError:
				__lowerCAmelCase         =							""
			try:
				__lowerCAmelCase         =							float(
				    (
				        (
				            float(product_mrp.strip("₹"  ).replace(","			,							""  )  )
				            - float(product_price.strip("₹"  ).replace(","			,							""  )  )
				        )
				        / float(product_mrp.strip("₹"  ).replace(","			,							""  )  )
				    )
				    * 1_0_0  )
			except ValueError:
				__lowerCAmelCase         =							float("nan"  )
		except AttributeError:
			pass
		__lowerCAmelCase         =							[
		    product_title,
		    product_link,
		    product_price,
		    product_rating,
		    product_mrp,
		    discount,
		]
	__lowerCAmelCase         =							" "
	__lowerCAmelCase         =							" "
	data_frame.index += 1
	return data_frame


if __name__ == "__main__":
					UpperCamelCase_   	=	"headphones"
					get_amazon_product_data(product).to_csv(f'''Amazon Product Data for {product}.csv''')








from __future__ import annotations

UpperCamelCase_   	=	[True] * 1_0_0_0_0_0_1
UpperCamelCase_   	=	2
while i * i <= 1_0_0_0_0_0_0:
					if seive[i]:
										for j in range(i * i, 1_0_0_0_0_0_1, i):
															UpperCamelCase_   	=	False
					i += 1






def 		_UpperCAmelCase   (	UpperCamelCase:     int  ):






	"""simple docstring"""


	return seive[n]






def 		_UpperCAmelCase   (	UpperCamelCase:     int  ):






	"""simple docstring"""


	return any(digit in "02468" for digit in str(UpperCamelCase  )  )






def 		_UpperCAmelCase   (	UpperCamelCase:     int = 1_0_0_0_0_0_0  ):






	"""simple docstring"""


	__lowerCAmelCase         =							[2]  # result already includes the number 2.
	for num in range(3			,							limit + 1			,							2  ):
		if is_prime(UpperCamelCase  ) and not contains_an_even_digit(UpperCamelCase  ):
			__lowerCAmelCase         =							str(UpperCamelCase  )
			__lowerCAmelCase         =							[int(str_num[j:] + str_num[:j]  ) for j in range(len(UpperCamelCase  )  )]
			if all(is_prime(UpperCamelCase  ) for i in list_nums  ):
				result.append(UpperCamelCase  )
	return result






def 		_UpperCAmelCase   (	):






	"""simple docstring"""


	return len(find_circular_primes()  )


if __name__ == "__main__":
					print(f'''{len(find_circular_primes()) = }''')






