1

new to the coding scene, looking for some help, or just an answered question.

I'm using selenium and chromedriver with python to scrape data from an interactive website.

I'm currently trying to scrape the effects of these items by hovering over each element in a loop, and then while I'm hovering over each one, grabbing the effect text inside by using this code.

from selenium import webdriver
driver = webdriver.Chrome(r'C:\Users\Hank\Desktop\chromedriver_win32\chromedriver.exe')
driver.get('https://steamcommunity.com/market/listings/440/Unusual%20Old%20Guadalajara')

from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support.expected_conditions import presence_of_element_located
from selenium.webdriver.common.action_chains import ActionChains
action = ActionChains(driver)
imgs = driver.find_elements(By.CLASS_NAME, 'market_listing_item_img_container')
for img in imgs:

    action.move_to_element(img).perform()
    effect = driver.find_elements(By.CLASS_NAME, 'descriptor')
    print(effect.text)

I was hoping that this would go through all of the images on the page using the find_elements(By.CLASS_NAME), hover over each one, and then grab the data inside. When I run the code, the page seems to be moving across each element. However, when it reaches the end, it gives me this error:

'raise exception_class(message, screen, stacktrace) selenium.common.exceptions.JavascriptException: Message: javascript error: Failed to execute 'elementsFromPoint' on 'Document': The provided double value is non-finite.'

Can someone help me understand what this means, and what I should try to do in order to get that data. I also assume I am not doing something in the right way that the program can understand what I want to achieve, so please let me know if I have an incorrect understanding of something.

Thanks for your time.

0 Answers0