Skip to main content

Primark scraping

Project description

# My Scraper

A Python library for scraping product details and availability from e-commerce websites.

Functions checking_status(url) Description: Checks the HTTP status code of a given URL. Parameters: url (str) - The URL to check. Returns: The URL if the status code is 200, otherwise None. get_product_links(url, country_tag, dict) Description: Retrieves product links and updates the dictionary with the new URL. Parameters: url (str) - The original URL. country_tag (str) - The country code to replace in the URL. dict (dict) - The dictionary to update with the new URL. Returns: A tuple containing the BeautifulSoup object and the updated dictionary. Get_driver(link) Description: Initializes and returns a Selenium WebDriver. Parameters: link (str) - The URL to navigate to. Returns: Selenium WebDriver instance. accept_cookies(driver) Description: Accepts cookies on the webpage if the button is present. Parameters: driver (WebDriver) - The Selenium WebDriver instance. Returns: None store_details(driver, dict_details, size_name) Description: Extracts store details (name, address, availability) and updates the dictionary. Parameters: driver (WebDriver) - The Selenium WebDriver instance. dict_details (dict) - The dictionary to update with store details. size_name (str) - The size category to update in the dictionary. Returns: Updated dictionary with store details. get_categories(soup) Description: Extracts product categories from a BeautifulSoup object. Parameters: soup (BeautifulSoup) - The BeautifulSoup object containing the page content. Returns: A tuple containing the main category, subcategory1, and subcategory2. get_products(url) Description: Retrieves product links from a sitemap URL. Parameters: url (str) - The sitemap URL. Returns: A list of product links. get_sizes(link) Description: Scrapes sizes and availability details for a product. Parameters: link (str) - The product URL. Returns: A dictionary with size and availability details. get_product(url) Description: Retrieves detailed product information from the given URL. Parameters: url (str) - The product URL. Returns: A dictionary containing product details (categories, name, price, description, image, etc.).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

prk_scraping_bib-0.2.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

prk_scraping_bib-0.2-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file prk_scraping_bib-0.2.tar.gz.

File metadata

  • Download URL: prk_scraping_bib-0.2.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.3

File hashes

Hashes for prk_scraping_bib-0.2.tar.gz
Algorithm Hash digest
SHA256 2bf3d6438d0392981462a49b3320b580c67a4632d99ee97aa3b7c8fe4fb88672
MD5 01b89811b5c16d4301e7488dfc3d0845
BLAKE2b-256 c81c5e3b2eb4959a7a4b5da97bee61ee73cb3cbff4382e361ec9fb43b29c6e29

See more details on using hashes here.

File details

Details for the file prk_scraping_bib-0.2-py3-none-any.whl.

File metadata

  • Download URL: prk_scraping_bib-0.2-py3-none-any.whl
  • Upload date:
  • Size: 6.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.3

File hashes

Hashes for prk_scraping_bib-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 911125ed77170f8e2957b17601a99b9ebf350eafeac6e76f8581dda6223045cd
MD5 ce5e68c9ff82fa40d17c619f6837dc00
BLAKE2b-256 7fe29445e6db42fe080a383624877cd9af23dd406181e45225b9ac0ab6cc5333

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page