-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_loadMoreScraper.py
28 lines (24 loc) · 1.07 KB
/
test_loadMoreScraper.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# Generated by Selenium IDE
import pytest
import time
import json
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.support import expected_conditions
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
class TestLoadMoreScraper():
def setup_method(self, method):
self.driver = webdriver.Chrome()
self.vars = {}
def teardown_method(self, method):
self.driver.quit()
def test_loadMoreScraper(self):
self.driver.get("https://www2.hm.com/en_ca/divided/shop-by-product/shirts-and-blouses.html")
self.driver.set_window_size(784, 864)
self.driver.execute_script("window.scrollTo(0,815.2000122070312)")
self.driver.execute_script("window.scrollTo(0,2025.5999755859375)")
self.driver.execute_script("window.scrollTo(0,2961.60009765625)")
self.driver.find_element(By.CSS_SELECTOR, ".js-load-more").click()