So I followed the tutorial by Techwithtim on Youtube and started running the script (it uses python and selenium). It worked for a while and then I got the Error: "ValueError: invalid literal for int() with base 10: '1,077'"
My code:
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.action_chains import ActionChains
import time
PATH = r"C:\Users\Leander\Documents\scraping\chromedriver.exe"
driver = webdriver.Chrome(PATH)
driver.get("https://orteil.dashnet.org/cookieclicker/")
driver.implicitly_wait(5)
cookie = driver.find_element_by_id("bigCookie")
cookie_count = driver.find_element_by_id("cookies")
items = [driver.find_element_by_id("productPrice" + str(i)) for i in range(1,-1,-1)]
actions = ActionChains(driver)
actions.click(cookie)
for i in range(1000000):
actions.perform()
count = int(cookie_count.text.split(" ")[0])
for item in items:
value = int(item.text) #cmd tells me the error is right here
if value <= count:
upgrade_actions = ActionChains(driver)
upgrade_actions.move_to_element(item)
upgrade_actions.click()
upgrade_actions.perform()
I think it might be because of the "items = [driver.find_element_by_id("productPrice" + str(i)) for i in range(1,-1,-1)]"-line because I don't completly understand what it does (the "in range" bit).
It might be helpful to know that the third upgrade costs 1100 cookies so it crashed right before reaching that mark. Upgrades 1 and 2 went fine for multiple times. If you need more information, just ask about it.
Thanks for your help!