Leela-Consultancy / PPDM_Dev_Prototype_Odoo

1 stars 3 forks source link

Create webscrapping code t read cookies #9

Open hariharan-leela opened 1 year ago

hariharan-leela commented 1 year ago

@Ashwin-Leela inatall odoo16

Ashwin-Leela commented 1 year ago

Currently working on the Python Automation Application which is supposed to search for Top Websites in mentioned categories and Store the information onto a CSV File.

Image

Ashwin-Leela commented 1 year ago

Researching to find the perfect source which would contain all the websites ranked and category-wise for the program.

Screenshot 2023-03-08 at 08 41 40
Ashwin-Leela commented 1 year ago

Created a temporary database with some data to parse it to the program. Will be working on how to implement it into the program.

image
hariharan-leela commented 1 year ago

@Ashwin-Leela update the progress here

Ashwin-Leela commented 1 year ago

Currently working on how to manually check for information regarding cookies for individual websites.

  1. Analysis of cookies stored by Amazon ( amazon.co.uk)
image
Ashwin-Leela commented 1 year ago
  1. Analysis of cookies stored by Argos ( argos.co.uk)
image
Ashwin-Leela commented 1 year ago

Working on developing Python Script which would extract the following

Screenshot 2023-06-13 at 14 27 22

information from ebay.co.uk

Ashwin-Leela commented 1 year ago

from selenium import webdriver from selenium.webdriver.chrome.options import Options

options = Options() options.add_argument("--headless") options.add_argument("--log-level=3") options.add_argument("--no-sandbox") options.add_argument("--disable-dev-shm-usage")

driver_path = "/path/to/chromedriver" driver = webdriver.Chrome(executable_path=driver_path, options=options)

driver.get("https://www.ebay.co.uk/")

cookies = driver.get_cookies()

for cookie in cookies: print(f"Name: {cookie['name']}") print(f"Value: {cookie['value']}") print(f"Domain: {cookie['domain']}") print(f"Path: {cookie['path']}") print(f"Secure: {cookie['secure']}") print(f"HttpOnly: {cookie['httpOnly']}") print(f"Expiry: {cookie['expiry']}") print("-------------------------------")

driver.quit()

Ashwin-Leela commented 1 year ago

from selenium import webdriver from selenium.webdriver.common.by import By import time driver_path = 'chromedriver' driver = webdriver.Chrome() driver.get("https://cookiepedia.co.uk/") driver.implicitly_wait(10) search_bar = driver.find_element(By.NAME, "search-box-input") search_bar.send_keys("ebay.co.uk") driver.find_element(By.XPATH, '//[@id="search-form"]/input[2]').click() print ("Strictly Necessary Cookies: " + driver.find_element(By.XPATH, '//[@id="row-second"]/div/div/div[2]/div[1]/div[1]/p/span').text) print ("Performance Cookies: " + driver.find_element(By.XPATH, '//[@id="row-second"]/div/div/div[2]/div[1]/div[2]/p/span').text) print ("Functionality Cookies: " + driver.find_element(By.XPATH, '//[@id="row-second"]/div/div/div[2]/div[1]/div[3]/p/span').text) print ("Targeting Cookies: " + driver.find_element(By.XPATH, '//[@id="row-second"]/div/div/div[2]/div[1]/div[4]/p/span').text) print ("Unknown Cookies: " + driver.find_element(By.XPATH, '//[@id="row-second"]/div/div/div[2]/div[1]/div[5]/p/span').text) time.sleep(30)

Ashwin-Leela commented 1 year ago

Editing the code to make sure it works for other websites in the same category as well from cookiepedia.co.uk

Ashwin-Leela commented 11 months ago

Currently working on debugging the code for the application to fetch cookie data from similar websites.

Ashwin-Leela commented 10 months ago

Researching similar websites to see how their data can be captured and implemented on the PPDM Website.