
Security News
CISA Extends MITRE Contract as Crisis Accelerates Alternative CVE Coordination Efforts
CISA extended MITRE’s CVE contract by 11 months, avoiding a shutdown but leaving long-term governance and coordination issues unresolved.
A python package to get amazon product and search data in json form. The package does not require any API keys as it works by scraping the amazon page.
A python package to get amazon product and search data in json form. The package does not require any API keys as it works by scraping the amazon page.
Reference: How To Scrape Amazon Product Details and Pricing using Python
pip install amazondata
To get Amazon product details from the url, use the following function.
from amazondata.product_details_extractor import ProductDetailsExtractor
product_details_extractor = ProductDetailsExtractor()
data = product_details_extractor.get_product_from_url('https://www.amazon.in/dp/B09JSYVNZ2')
print(data)
To get Amazon product details from the ASIN (Amazon Standard Identification Number) code, use the following function.
from amazondata.product_details_extractor import ProductDetailsExtractor
product_details_extractor = ProductDetailsExtractor()
data = product_details_extractor.get_product_from_asin_code('B09JSYVNZ2')
print(data)
To get the list of products from search query use the following function
from amazondata.search_result_extractor import SearchResultExtractor
search_result_extractor = SearchResultExtractor()
data = search_result_extractor.search('perfume for men', 3)
print(data)
NOTE: Optionally, you can pass custom headers
to all these functions. The default headers value is:
headers = {
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
"Sec-Fetch-Site": "none",
"Host": "www.amazon.in",
"Accept-Language": "en-IN,en-GB;q=0.9,en;q=0.8",
"Sec-Fetch-Mode": "navigate",
"Accept-Encoding": "gzip, deflate, br",
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Safari/605.1.15",
"Connection": "keep-alive",
"Upgrade-Insecure-Requests": "1",
"Sec-Fetch-Dest": "document",
"Priority": "u=0, i",
}
In case the the scraper gets blocked from Amazon, you can fetch the html code using selenium and pass the html code to the following function
data = extract_search_results(html_code)
data = extract_product_details(html_code)
FAQs
A python package to get amazon product and search data in json form. The package does not require any API keys as it works by scraping the amazon page.
We found that amazondata demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISA extended MITRE’s CVE contract by 11 months, avoiding a shutdown but leaving long-term governance and coordination issues unresolved.
Product
Socket's Rubygems ecosystem support is moving from beta to GA, featuring enhanced security scanning to detect supply chain threats beyond traditional CVEs in your Ruby dependencies.
Research
The Socket Research Team investigates a malicious npm package that appears to be an Advcash integration but triggers a reverse shell during payment success, targeting servers handling transactions.